Apache Web Server Configuration Instructions for CentOS 7

1. Disable SeLinux

#cd /etc/selinux

#vi config

  change "SELINUX=enforcing" to "SELINUX=permissive"

#setenforce 0

 

2. Install required modules(httpd,perl, and perl-CGI)

#yum -y install httpd

#yum -y install perl

#yum -y install perl-CGI

 

3. Enable apache web server

#systemctl enable httpd

#systemctl start httpd

 

4. Configure apache web server

#mkdir /home/*/public_html/cgi-bin   

  * means the user home direction

#cd /etc/httpd/conf.d

#vi userdir.conf

  comment out "UserDir disabled" to "#UserDir disabled"

  uncomment "#UserDir public_html" to "UserDir public_html"

  add the following to the end of the file:

    <Directory /home/*/public_html/cgi-bin>

      Options + ExecCGI

      AddHandler cgi-script .cgi

    </Directory>

 

5. Restart apache web server

#systemctl restart httpd

 

参考自:http://www.webmo.net/support/apache_centos7.html

 

posted @ 2016-03-07 15:27  冽泉  阅读(78)  评论(0)    收藏  举报