Home  >  Article  >  Backend Development  >  Tips for using Apache

Tips for using Apache

WBOY
WBOYOriginal
2016-08-08 09:31:251207browse

1. Multi-site configuration:

1. Open httpd.conf, set and enable the virtual directory:

<Directory />
    options FollowSymLinks
    AllowOverride all
    Allow from all
    #Require all denied
</Directory>

2. Specify the virtual directory location:

Include conf/extra/httpd-vhosts.conf,

3. Modify the node

<pre name="code" class="html"><VirtualHost *:80>
        ServerAdmin webmaster@dummy-host.example.com 
        DocumentRoot "/var/www/cloud_whirlpool_china"
        ServerName cloud.whirlpool-china.com
        ServerAlias cloud.whirlpool-china.com
        ErrorLog "logs/cloud.whirlpool-china.com-error_log"
        CustomLog "logs/cloud.whirlpool-china.com-access_log" common
</VirtualHost> 



You can also configure VirtualHost directly in the httpd.conf file.

2. Remote access permission settings:

1. Set up the firewall

2. Modify the configuration file:

/etc/httpd/conf/httpd.conf

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

3. Common commands

/bin/systemctl start httpd.service     #启动
/bin/systemctl restart httpd.service   #重启
/bin/systemctl status httpd.service    #查看状态

The above introduces the Tips for using Apache, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn