User Tools

Site Tools


software:webdesign

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
software:webdesign [2017/10/20 18:12] superwizardsoftware:webdesign [2019/07/13 07:30] (current) – [Sample Virtual Hosts] superwizard
Line 81: Line 81:
 </style> </style>
 </html> </html>
 +
 +====== Check List for Adding Virtual Host ======
 +
 +From: 
 +
 +  * Add database
 +  * Add dns entry to registrar nameserver
 +  * Add dns name to hosts
 +  * Add files
 +  * Add Apache2 virtualhost configuration /etc/apache/sitesavailable
 +  * Add service to Apache2
 +  * Start service
 +
 +
 +
 +====== Apache Main Conf  ======
 +
 +<code>
 +ServerAdmin you@example.com
 +
 +# ServerName gives the name and port that the server uses to identify itself.
 +ServerName 0bf0b12d169b
 +
 +# Virtual hosts
 +#Include conf/extra/httpd-vhosts.conf
 +
 +</code>
 +
 +====== Sample Virtual Hosts  ======
 +
 +<code>
 +<VirtualHost *:80>
 + # The ServerName directive sets the request scheme, hostname and port that
 + # the server uses to identify itself. This is used when creating
 + # redirection URLs. In the context of virtual hosts, the ServerName
 + # specifies what hostname must appear in the request's Host: header to
 + # match this virtual host. For the default virtual host (this file) this
 + # value is not decisive as it is used as a last resort host regardless.
 + # However, you must set it for any further virtual host explicitly.
 + 
 +        ServerName localhost
 + ServerAdmin madmin@madmin.yall
 + DocumentRoot /var/www/html
 +
 + ErrorLog ${APACHE_LOG_DIR}/error.log
 + CustomLog ${APACHE_LOG_DIR}/access.log combined
 +
 +</VirtualHost>
 +
 +<VirtualHost *:3321>
 + ServerName drupy.madmin.yall
 +        ServerAlias *.madmin.yall
 +
 + ServerAdmin madmin@madmin.yall
 + DocumentRoot /var/www/html/web/
 +
 + ErrorLog ${APACHE_LOG_DIR}/error.log
 + CustomLog ${APACHE_LOG_DIR}/access.log combined
 +</VirtualHost>
 +
 +
 +<VirtualHost *:3321>
 + ServerName services.madmin.yall
 +        ServerAlias *.madmin.yall
 +
 + ServerAdmin madmin@madmin.yall
 + DocumentRoot /usr/share/wordpress
 +
 + ErrorLog ${APACHE_LOG_DIR}/error.log
 + CustomLog ${APACHE_LOG_DIR}/access.log combined
 +
 +        Alias /blog /usr/share/wordpress
 +        <Directory /usr/share/wordpress>
 +              Options FollowSymLinks
 +              AllowOverride Limit Options FileInfo
 +              DirectoryIndex index.php
 +              Order allow,deny
 +              Allow from all
 +        </Directory>
 +        <Directory /usr/share/wordpress/wp-content>
 +              Options FollowSymLinks
 +              Order allow,deny
 +              Allow from all
 +        </Directory>
 +
 +</VirtualHost>
 +
 +
 +</code>
 +
 +
 +
 +
 +
 +====== Common Apache Misconfigurations ======
 +
 +From: https://wiki.apache.org/httpd/CommonMisconfigurations
 +
 +<code>
 +NameVirtualHost *:80
 +
 +# This is wrong. No matching NameVirtualHost some.domain.com line.
 +<VirtualHost some.domain.com>
 +  # Options and stuff defined here.
 +</VirtualHost>
 +
 +# This would be correct.
 +<VirtualHost *:80>
 +  ServerName some.domain.com
 +  # Options and stuff defined here.
 +</VirtualHost>
 +</code>
  
 ====== Setup up Apache2 for multiple virtual hosts (websites) ====== ====== Setup up Apache2 for multiple virtual hosts (websites) ======
  
 From: https://httpd.apache.org/docs/trunk/vhosts/examples.html From: https://httpd.apache.org/docs/trunk/vhosts/examples.html
 +
 +Also: https://httpd.apache.org/docs/trunk/vhosts/examples.html
  
 <code> <code>
 +
 +Remember to add or remove site with
 +
 +sudo a2ensite
 +sudo a2dissite
 +
 +
 +
  
 Name-based hosts on more than one IP address. Name-based hosts on more than one IP address.
Line 262: Line 384:
  
 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
 +
 +
 +<VirtualHost *:80>
 + # The ServerName directive sets the request scheme, hostname and port that
 + # the server uses to identify itself. This is used when creating
 + # redirection URLs. In the context of virtual hosts, the ServerName
 + # specifies what hostname must appear in the request's Host: header to
 + # match this virtual host. For the default virtual host (this file) this
 + # value is not decisive as it is used as a last resort host regardless.
 + # However, you must set it for any further virtual host explicitly.
 + 
 +        ServerName localhost
 +
 + ServerAdmin mzztop@zzgxg.ubow
 + DocumentRoot /var/www/html
 +
 + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
 + # error, crit, alert, emerg.
 + # It is also possible to configure the loglevel for particular
 + # modules, e.g.
 + #LogLevel info ssl:warn
 +
 + ErrorLog ${APACHE_LOG_DIR}/error.log
 + CustomLog ${APACHE_LOG_DIR}/access.log combined
 +
 +</VirtualHost>
 +
 +<VirtualHost *:3321>
 + ServerName drupal.zzgxg.ubow
 +        ServerAlias *.zzgxg.ubow
 +
 + ServerAdmin mzztop@zzgxg.ubow
 + DocumentRoot /var/www/html/web/
 +
 + ErrorLog ${APACHE_LOG_DIR}/error.log
 + CustomLog ${APACHE_LOG_DIR}/access.log combined
 +
 +</VirtualHost>
 +
 +<VirtualHost *:3321>
 +        # Wordpress Site
 +        ServerName services.zzgxg.ubow
 +        ServerAlias *.zzgxg.ubow
 +
 + ServerAdmin mzztop@zzgxg.ubow
 + DocumentRoot /usr/share/wordpress
 +
 + ErrorLog ${APACHE_LOG_DIR}/error.log
 + CustomLog ${APACHE_LOG_DIR}/access.log combined
 +
 +        Alias /blog /usr/share/wordpress
 +        <Directory /usr/share/wordpress>
 +              Options FollowSymLinks
 +              AllowOverride Limit Options FileInfo
 +              DirectoryIndex index.php
 +              Order allow,deny
 +              Allow from all
 +        </Directory>
 +        <Directory /usr/share/wordpress/wp-content>
 +              Options FollowSymLinks
 +              Order allow,deny
 +              Allow from all
 +        </Directory>
 +
 +</VirtualHost>
  
 </code> </code>
Line 380: Line 567:
  
 From: http://themeforest.net/item/enfold-responsive-multipurpose-theme/4519990 From: http://themeforest.net/item/enfold-responsive-multipurpose-theme/4519990
 +
 +Tutorial: https://ferdykorpershoek.com/how-to-create-a-website-enfold-2017/
 +
  
  
software/webdesign.1508523159.txt.gz · Last modified: 2017/10/20 18:12 by superwizard