Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howtos:network_services:setup_apache [2018/12/23 21:42 (UTC)]
ellendhel [BASIC SETUP] Formatting
howtos:network_services:setup_apache [2018/12/23 21:51 (UTC)] (current)
ellendhel [VHOSTS WITH INDIVIDUAL CGI-BIN DIRECTORIES] Formatting
Line 53: Line 53:
  
  
-====== ​USER DIRECTORIES ​====== +====== ​User Directories ​======
-This will allow users to have individual web space (/​home/​USER/​public_html). ​ These can be accessed from the web by adding "​~USERNAME"​ to the URL. \\ +
-EXAMPLE: \\ +
- ​http://​www.slackware.com/​~pat+
  
 +This will allow users to have individual web space (/​home/​user/​public_html). ​ These can be accessed from the web by adding "​~username"​ to the URL.
  
-1) Edit /​etc/​httpd/​httpd.conf - Here is what you care about, change/​uncomment the following lines as necessary:+Example: <​nowiki>​http://​www.slackware.com/​~pat</​nowiki>​ 
 + 
 + 
 +Edit /​etc/​httpd/​httpd.conf - Here is what you care about, change/​uncomment the following lines as necessary:
 <​code>​ vi /​etc/​httpd/​httpd.conf <​code>​ vi /​etc/​httpd/​httpd.conf
  
Line 68: Line 69:
   Include /​etc/​httpd/​extra/​httpd-userdir.conf</​code>​   Include /​etc/​httpd/​extra/​httpd-userdir.conf</​code>​
  
-2) Edit /​etc/​httpd/​extra/​httpd-userdir.conf,​ change/​uncomment the following:+Edit /​etc/​httpd/​extra/​httpd-userdir.conf,​ change/​uncomment the following:
 <​code>​vi /​etc/​httpd/​extra/​httpd-userdir.conf <​code>​vi /​etc/​httpd/​extra/​httpd-userdir.conf
  
Line 77: Line 78:
   </​Directory></​code>​   </​Directory></​code>​
  
-3) Restart Apache+Restart Apache
 <​code>/​etc/​rc.d/​rc.httpd restart</​code>​ <​code>/​etc/​rc.d/​rc.httpd restart</​code>​
  
  
-====== ​ENABLE ​CGI-BIN ====== +====== ​Enable ​CGI-BIN ======
-This enables CGI script execution on your webserver.+
  
 +This enables CGI script execution on your webserver.
  
-1) Edit /​etc/​httpd/​httpd.conf - Here is what you care about, change/​uncomment the following lines as necessary:+Edit /​etc/​httpd/​httpd.conf - Here is what you care about, change/​uncomment the following lines as necessary:
 <​code>​ vi /​etc/​httpd/​httpd.conf <​code>​ vi /​etc/​httpd/​httpd.conf
  
Line 106: Line 107:
   </​IfModule></​code>​   </​IfModule></​code>​
  
-2) Restart Apache+Restart Apache
 <​code>/​etc/​rc.d/​rc.httpd restart</​code>​ <​code>/​etc/​rc.d/​rc.httpd restart</​code>​
  
 **HINT:** Your cgi-bin directory will be /​srv/​httpd/​cgi-bin/​. The scripts can be accessed by adding /​cgi-bin/​SCRIPTNAME to the website URL. **HINT:** Your cgi-bin directory will be /​srv/​httpd/​cgi-bin/​. The scripts can be accessed by adding /​cgi-bin/​SCRIPTNAME to the website URL.
  
-EXAMPLE\\ +Example<​nowiki>​http://​www.slackware.com/​cgi-bin/​awesomescript.pl</​nowiki>​
- http://​www.slackware.com/​cgi-bin/​awesomescript.pl+
     ​     ​
-**NOTE: This does not apply to php scripts, see the below for them.**+**NOTE**: This does not apply to PHP scripts, see the below for them.
   ​   ​
  
  
-====== ​USER CGI-BIN ====== +====== ​User CGI-BIN ======
-This will allow users to run CGI scripts out of their /​home/​USER/​public_html/​cgi-bin directory. Their scripts can be accessed through their user directories.+
  
-EXAMPLE: +This will allow users to run CGI scripts out of their /home/user/public_html/​cgi-bin ​directory. Their scripts can be accessed through their user directories.
- http://www.slackware.com/~pat/cgi-bin/webform.pl+
  
-1) Setup CGI-BIN as described above.+Example: <​nowiki>​http://​www.slackware.com/​~pat/​cgi-bin/webform.pl</​nowiki>​
  
-2) Edit /​etc/​httpd/​extra/​httpd-userdir.conf - Here is what you care about, change/​uncomment the following lines as necessary:+Setup CGI-BIN as described above. 
 + 
 +Edit /​etc/​httpd/​extra/​httpd-userdir.conf - Here is what you care about, change/​uncomment the following lines as necessary:
 <​code>​vi /​etc/​httpd/​extra/​httpd-userdir.conf <​code>​vi /​etc/​httpd/​extra/​httpd-userdir.conf
  
Line 134: Line 134:
   </​Directory></​code>​   </​Directory></​code>​
  
-3) Restart Apache+Restart Apache
 <​code>/​etc/​rc.d/​rc.httpd restart</​code>​ <​code>/​etc/​rc.d/​rc.httpd restart</​code>​
-====== ​ENABLE ​PHP ======+====== ​Enable ​PHP ====== 
 [[howtos:​network_services:​setup_apache_php_mysql|http://​docs.slackware.com/​howtos:​network_services:​setup_apache_php_mysql]] [[howtos:​network_services:​setup_apache_php_mysql|http://​docs.slackware.com/​howtos:​network_services:​setup_apache_php_mysql]]
  
-====== ​VIRTUAL HOSTS ====== +====== ​Virtual Hosts ====== 
-1) Edit /​etc/​httpd/​httpd.conf - Here is what you care about, change/​uncomment the following lines as necessary:+ 
 +Edit /​etc/​httpd/​httpd.conf - Here is what you care about, change/​uncomment the following lines as necessary:
  
 <​code>​vi /​etc/​httpd/​httpd.conf <​code>​vi /​etc/​httpd/​httpd.conf
Line 146: Line 148:
   Include /​etc/​httpd/​extra/​httpd-vhosts.conf</​code>​   Include /​etc/​httpd/​extra/​httpd-vhosts.conf</​code>​
  
-2) Edit /​etc/​httpd/​extra/​httpd-vhosts.conf - Here is what you care about, add one of these entries for each virtual host:+Edit /​etc/​httpd/​extra/​httpd-vhosts.conf - Here is what you care about, add one of these entries for each virtual host:
  
 <​code>​vi /​etc/​httpd/​extra/​httpd-vhosts.conf <​code>​vi /​etc/​httpd/​extra/​httpd-vhosts.conf
Line 168: Line 170:
   </​VirtualHost></​code>​   </​VirtualHost></​code>​
  
-3) Restart Apache+Restart Apache
 <​code>/​etc/​rc.d/​rc.httpd restart</​code>​ <​code>/​etc/​rc.d/​rc.httpd restart</​code>​
  
-**NOTE:** I run my vhosts as users so, the document roots are under /home/USER directories. ​Y**ou do not have to do this.** You can put the document roots anywhere you like.+**NOTE:** I run my vhosts as users so, the document roots are under /home/user directories. ​You do not have to do this. You can put the document roots anywhere you like. 
 + 
 +Example: 
 + 
 +/​srv/​www/​htdocs/​server1 \\ 
 +/​srv/​www/​htdocs/​server2 \\
  
-EXAMPLE\\ +**NOTE 2:** These do not affect your default webserver setting in /etc/httpd/httpd.confThat web server instance will still work and be the default if a plain IP in used as the URL.
- /srv/www/htdocs/​server1 \\ +
- /​srv/​www/​htdocs/​server2 \\ +
- etc... \\+
  
-**NOTE2:** These do not affect your default webserver setting in /​etc/​httpd/​httpd.conf. That web server instance will still work and be the default if a plain IP in used as the URL. 
  
 +====== Vhosts with individual CGI-BIN directories ======
  
-====== VHOSTS WITH INDIVIDUAL CGI-BIN DIRECTORIES ====== +If you have virtual hosts that need CGI (or need CGI in their own directory) you can do it like this:
-If you have virtual hosts that need cgi (or need cgi in their own directory) you can do it like this:+
  
-1) Edit /​etc/​httpd/​extra/​httpd-vhosts.conf - Add one of these entries for each vhost that needs unique cgi-bin directories:​+Edit /​etc/​httpd/​extra/​httpd-vhosts.conf - Add one of these entries for each vhost that needs unique cgi-bin directories:​
  
 <​code>​vi /​etc/​httpd/​extra/​httpd-vhosts.conf <​code>​vi /​etc/​httpd/​extra/​httpd-vhosts.conf
Line 193: Line 196:
   </​Directory></​code>​   </​Directory></​code>​
  
-2) Restart Apache+Restart Apache
 <​code>/​etc/​rc.d/​rc.httpd restart</​code>​ <​code>/​etc/​rc.d/​rc.httpd restart</​code>​
  

In Other Languages
QR Code
QR Code howtos:network_services:setup_apache (generated for current page)