sh #centos #httpd #vhost
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh #centos #httpd #vhost相关的知识,希望对你有一定的参考价值。
sudo mkdir -p /var/www/example.com/html
sudo mkdir -p /var/www/example.com/log
sudo chown -R $USER:$USER /var/www/example.com/html
sudo chmod -R 755 /var/www
sudo nano /var/www/example.com/html/index.html
sudo mkdir /etc/httpd/sites-available /etc/httpd/sites-enabled
sudo nano /etc/httpd/conf/httpd.conf
=at the end==> IncludeOptional sites-enabled/*.conf
sudo nano /etc/httpd/sites-available/example.com.conf
===>
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/example.com/html
ErrorLog /var/www/example.com/log/error.log
CustomLog /var/www/example.com/log/requests.log combined
</VirtualHost>
sudo ln -s /etc/httpd/sites-available/example.com.conf /etc/httpd/sites-enabled/example.com.conf
sudo setsebool -P httpd_unified 1
sudo ls -dZ /var/www/example.com/log/
sudo semanage fcontext -a -t httpd_log_t "/var/www/example.com/log(/.*)?"
sudo restorecon -R -v /var/www/example.com/log
sudo ls -dZ /var/www/example.com/log/
sudo systemctl restart httpd
以上是关于sh #centos #httpd #vhost的主要内容,如果未能解决你的问题,请参考以下文章
sh 翻译:“OS X 10.10 Yosemite本地开发环境,Apache,PHP和MySQL与Homebrew”7。继续配置httpd-vhosts.conf
centos6.2安装好lamp环境后,要配置虚拟主机的目录 但是找不到apache下的httpd-vhosts.conf
sh 翻译:“OS X 10.10 Yosemite本地开发环境,Apache,PHP和MySQL与Homebrew”8。继续配置`httpd-vhosts.conf`,以为为一条终端命令,复制整个区
CentOS 6下Apache的https虚拟主机实践
CentOS7配置httpd虚拟主机
CentOS8下使用Apache Httpd创建源服务