Facebook
From anon, 1 Week ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 24
  1. httpd  
  2. /etc/httpd/conf/httpd.conf
  3.  
  4. apache2
  5. /etc/apache2/apache2.conf
  6.             /site-available/[name].conf
  7.             /site-enable/[softlink of [name].conf]
  8.  
  9. Newer options in config file are overwritten
  10.  
  11. Work directory: /etc/www
  12.  
  13. Open config file /etc/apache2/apache2.conf
  14. Add following to the bottom:
  15.  
  16. ServerSignature off
  17. ServerName testapache.spqr
  18. ServerAdmin admin@testapache.spqr
  19. <Directory "/var/www/">
  20.         Options Indexes FollowSymLinks
  21.         AllowOverride None
  22.         Order allow,deny
  23.         Allow from all
  24. </Directory>
  25.  
  26. Hosts may need to be changed for local access.
  27.  
  28. Virtual hosts:
  29. Create folder in /var/www/[name]
  30. Create config file in /etc/apache2/sites-available/[name].conf
  31.  
  32. VirtualHost *:80>    
  33.         ServerName [name].spqr    
  34.         ServerAdmin admin@[name].spqr    
  35.         DocumentRoot /var/www/[name]/    
  36. </VirtualHost>  
  37.  
  38. Create soft link in /etc/apache2/sites-enabled/[name].conf
  39. Restart apache
  40.  
  41.  
  42. nginx
  43. Create folder in /var/www/[name]
  44. Create config file in /etc/nginx/sites-available/[name].conf
  45.  
  46. server {
  47.         listen 80;
  48.         server_name italia.spqr;
  49.         root /var/www/italia/;
  50.         location / {
  51.                    }
  52. }
  53.  
  54. location /[other name] {
  55.                         return 200 "[any text you want]
  56.                         }
  57.  
  58. Create soft link in /etc/nginx/sites-enabled/[name].conf
  59. Restart nginx
  60.  
  61. Restart server via:
  62. nginx -s reload
  63.  
  64. Stop server
  65. nginx -s stop
  66.  
  67. Launch server
  68. nginx
  69.