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
Last revisionBoth sides next revision
software:webdesign [2017/10/18 05:41] superwizardsoftware:webdesign [2019/07/13 07:26] – [Apache Main Conf] superwizard
Line 82: Line 82:
 </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>
 +
 +
 +
 +
 +
 +</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) ======
 +
 +From: https://httpd.apache.org/docs/trunk/vhosts/examples.html
 +
 +Also: https://httpd.apache.org/docs/trunk/vhosts/examples.html
 +
 +<code>
 +
 +Remember to add or remove site with
 +
 +sudo a2ensite
 +sudo a2dissite
 +
 +
 +
 +
 +Name-based hosts on more than one IP address.
 +Note
 +
 +Any of the techniques discussed here can be extended to any number of IP addresses.
 +
 +The server has two IP addresses. On one (172.20.30.40), we will serve the "main" server, server.example.com and on the other (172.20.30.50), we will serve two or more virtual hosts.
 +
 +Listen 80
 +
 +# This is the "main" server running on 172.20.30.40
 +ServerName server.example.com
 +DocumentRoot "/www/mainserver"
 +
 +<VirtualHost 172.20.30.50>
 +    DocumentRoot "/www/example1"
 +    ServerName www.example.com
 +
 +    # Other directives here ...
 +</VirtualHost>
 +
 +<VirtualHost 172.20.30.50>
 +    DocumentRoot "/www/example2"
 +    ServerName www.example.org
 +
 +    # Other directives here ...
 +</VirtualHost>
 +
 +Any request to an address other than 172.20.30.50 will be served from the main server. A request to 172.20.30.50 with an unknown hostname, or no Host: header, will be served from www.example.com.
 +
 +</code>
 +
 +
 +====== correct file permissions for wordpress ======
 +
 +From: https://stackoverflow.com/questions/18352682/correct-file-permissions-for-wordpress
 +
 +<code>
 +When you setup WP you (the webserver) may need write access to the files. So the access 
 +rights may need to be loose.
 +
 +chown www-data:www-data  -R * # Let Apache be owner
 +find . -type d -exec chmod 755 {} \;  # Change directory permissions rwxr-xr-x
 +find . -type f -exec chmod 644 {} \;  # Change file permissions rw-r--r--
 +
 +After the setup you should tighten the access rights, according to Hardening WordPress all 
 +files except for wp-content should be writable by your user account only. wp-content must 
 +be writable by www-data too.
 +
 +(sudo chown www-data:www-data -R /usr/share/wordpress)
 +
 +chown <username>:<username>  -R * # Let your useraccount be owner
 +chown www-data:www-data wp-content # Let apache be owner of wp-content
 +</code>
 +
 +
 +====== Wordpress Changing_The_Site_URL note addition of Port to site url ======
 +
 +From: http://codex.wordpress.org/Changing_The_Site_URL
 +
 +
 +<code>
 +Thsi re-writes the url that is sent to wordpress. must send back a compatible url for
 +source of browser request
 +</code>
 +
 +====== Setup Virtual hosts Ubuntu LAMP Wordpress ======
 +
 +From: https://help.ubuntu.com/14.04/serverguide/serverguide.pdf
 +
 +htaccess: https://www.askapache.com/htaccess/#Htaccess_Evolved
 +
 +VirtualHosts: https://httpd.apache.org/docs/trunk/vhosts/examples.html
 +
 +ApacheCoreFeatures: https://httpd.apache.org/docs/2.4/mod/core.html#serveralias
 +
 +<code>
 +For configuring your first WordPress application, configure an apache site. Open 
 +/etc/apache2/sites-available/wordpress.conf
 + and write the following lines:
 +        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>
 +Enable this new WordPress site
 +sudo a2ensite wordpress
 +
 +
 +etc/wordpress/
 +config-10.211.55.50.php, /etc/wordpress/config-hostalias1.php, etc. These instructions assume you can access
 +Apache via the localhost hostname (perhaps by using an ssh tunnel) if not, replace /etc/wordpress/config-
 +localhost.php with /etc/wordpress/config-NAME_OF_YOUR_VIRTUAL_HOST.php
 +
 +Setup Database for each instance
 +</code>
 +
 +
 +<code>
 +For remote accress had to run on Separate port (3221)
 +<VirtualHost *:3221>
 + # 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 services.domain.com
 +        ServerAlias *.domain.com
 +
 + ServerAdmin bob@youruncle
 + DocumentRoot /usr/share/wordpress
 +
 + # 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
 +
 + # For most configuration files from conf-available/, which are
 + # enabled or disabled at a global level, it is possible to
 + # include a line for only one particular virtual host. For example the
 + # following line enables the CGI configuration for this host only
 + # after it has been globally disabled with "a2disconf".
 + #Include conf-available/serve-cgi-bin.conf
 +        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>
 +
 +BindPorts: https://httpd.apache.org/docs/2.4/bind.html
 +
 +<code>
 +example change /etc/apache2/ports.conf
 +
 +# If you just change the port or add more ports here, you will likely also
 +# have to change the VirtualHost statement in
 +# /etc/apache2/sites-enabled/000-default.conf
 +
 +Listen 3321 TCP
 +Listen 80
 +<IfModule ssl_module>
 + Listen 443
 +</IfModule>
 +
 +<IfModule mod_gnutls.c>
 + Listen 443
 +</IfModule>
 +
 +# 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>
  
 ====== PHP Information Page ====== ====== PHP Information Page ======
Line 188: Line 522:
 </code> </code>
  
-====== Changing_The_Site_URL ====== 
  
-From: http://codex.wordpress.org/Changing_The_Site_URL 
  
 ====== Moving WordPress ====== ====== Moving WordPress ======
Line 200: Line 532:
  
 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.txt · Last modified: 2019/07/13 07:30 by superwizard