[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
howtos:network_services:setup_apache [2015/03/29 08:47 (UTC)] – Saving so I don't lose work arfon | howtos:network_services:setup_apache [2018/12/23 21:51 (UTC)] – [VHOSTS WITH INDIVIDUAL CGI-BIN DIRECTORIES] Formatting ellendhel | ||
---|---|---|---|
Line 3: | Line 3: | ||
This is a general how to to get a basic httpd service up and running. | This is a general how to to get a basic httpd service up and running. | ||
- | Applies to: \\ | + | Applies to: |
- | | + | |
- | | + | |
- | ====== | + | ====== |
- | 1) Edit / | + | |
+ | Edit / | ||
< | < | ||
- | ServerAdmin you@myawesomeserver.com | + | |
+ | | ||
ServerName www.myawesomeserver.com: | ServerName www.myawesomeserver.com: | ||
| | ||
Line 35: | Line 37: | ||
CustomLog "/ | CustomLog "/ | ||
| | ||
- | | + | |
- | Include / | + | Include / |
+ | # Optional | ||
+ | Include / | ||
</ | </ | ||
All other default settings should be good. | All other default settings should be good. | ||
- | HINT: With these settings, your default webpages should be put in / | + | Make httpd start on boot. |
- | 2) Make it start on boot. | ||
< | < | ||
/ | / | ||
+ | **HINT:** With these settings, your default webpages should be put in / | ||
- | ====== USER DIRECTORIES ====== | ||
- | This will allow users to have individual web space (/ | ||
- | EXAMPLE: \\ | ||
- | | ||
+ | ====== User Directories ====== | ||
- | 1) Edit / | + | This will allow users to have individual web space (/ |
+ | |||
+ | Example: < | ||
+ | |||
+ | |||
+ | Edit / | ||
< | < | ||
Line 63: | Line 69: | ||
Include / | Include / | ||
- | 2) Edit / | + | Edit / |
< | < | ||
Line 72: | Line 78: | ||
</ | </ | ||
- | 3) Restart Apache | + | Restart Apache |
< | < | ||
- | ====== CGI-BIN ====== | + | ====== |
This enables CGI script execution on your webserver. | This enables CGI script execution on your webserver. | ||
- | + | Edit / | |
- | 1) Edit / | + | |
< | < | ||
+ | |||
LoadModule proxy_fcgi_module lib64/ | LoadModule proxy_fcgi_module lib64/ | ||
LoadModule proxy_scgi_module lib64/ | LoadModule proxy_scgi_module lib64/ | ||
Line 100: | Line 107: | ||
</ | </ | ||
- | HINT: Your cgi-bin directory will be /srv/httpd/ | + | Restart Apache |
+ | < | ||
- | EXAMPLE: \\ | + | **HINT:** Your cgi-bin directory will be / |
- | http:// | + | |
+ | Example: < | ||
| | ||
- | **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. |
| | ||
- | ====== | + | ====== |
- | to be added | + | |
+ | This will allow users to run CGI scripts out of their / | ||
+ | |||
+ | Example: < | ||
+ | |||
+ | Setup CGI-BIN as described above. | ||
+ | |||
+ | Edit / | ||
+ | < | ||
+ | |||
+ | < | ||
+ | Options ExecCGI | ||
+ | SetHandler cgi-script | ||
+ | </ | ||
+ | |||
+ | Restart Apache | ||
+ | < | ||
+ | ====== Enable PHP ====== | ||
+ | |||
+ | [[howtos: | ||
+ | |||
+ | ====== Virtual Hosts ====== | ||
+ | |||
+ | Edit / | ||
+ | |||
+ | < | ||
+ | |||
+ | Include / | ||
+ | |||
+ | Edit / | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | ServerAdmin webmaster@www.server1.com | ||
+ | DocumentRoot "/ | ||
+ | ServerName server1.com | ||
+ | ServerAlias www.server1.com | ||
+ | ErrorLog "/ | ||
+ | CustomLog "/ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ServerAdmin webmaster@www.server2.com | ||
+ | DocumentRoot "/ | ||
+ | ServerName server2.com | ||
+ | ServerAlias www.server2.com | ||
+ | ErrorLog "/ | ||
+ | CustomLog "/ | ||
+ | </ | ||
+ | |||
+ | Restart Apache | ||
+ | < | ||
+ | |||
+ | **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: | ||
+ | |||
+ | / | ||
+ | / | ||
+ | |||
+ | **NOTE 2:** These do not affect your default webserver setting in / | ||
+ | |||
+ | |||
+ | ====== 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: | ||
+ | |||
+ | Edit / | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | Options ExecCGI | ||
+ | SetHandler cgi-script | ||
+ | </ | ||
+ | |||
+ | Restart Apache | ||
+ | < | ||
+ | **HINT:** I usually put these with their respective < | ||
- | ====== VIRTUAL HOSTS ====== | + | **NOTE:** Change the "/ |
- | to be added | + | |