Admin Panel 2: Admin Virtual Host: Difference between revisions

m
Reverted edits by Upazixorys (Talk); changed back to last version by BobS
No edit summary
m (Reverted edits by Upazixorys (Talk); changed back to last version by BobS)
Line 1: Line 1:
=[http://yxiwisewava.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
{{Uc_nav_apanel2}}
{{Uc_nav_apanel2}}
'''Admin Virtual Host'''
'''Admin Virtual Host'''
Line 23: Line 22:
To have separate logs when filling in the Admin Virtual Host form (Optional additions) you add the following two lines to each virtual host:
To have separate logs when filling in the Admin Virtual Host form (Optional additions) you add the following two lines to each virtual host:


{| cellpadding="8" cellspacing="1" style="background:#000000;"
{| cellpadding="8" cellspacing="1" style="background:#000000;"
|style="background:#f5f5f5;"|
|style="background:#f5f5f5;"|
ErrorLog logs/name_error.log<br>
ErrorLog logs/name_error.log<br>
CustomLog logs/name_custom.log '''combined'''
CustomLog logs/name_custom.log '''combined'''
|}
|}
Line 37: Line 36:
The second parameter specifies what will be written to the log file (if this is missing, it prevents the server running) UniServer has the following defined:
The second parameter specifies what will be written to the log file (if this is missing, it prevents the server running) UniServer has the following defined:


{| cellpadding=&quot;8&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;
{| cellpadding="8" cellspacing="1" style="background:#000000;"
|style=&quot;background:#f5f5f5;&quot;|
|style="background:#f5f5f5;"|
LogFormat &quot;%h % %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; '''combined'''&lt;br&gt;
LogFormat "%h % %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" '''combined'''<br>
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b&quot; '''common'''&lt;br&gt;
LogFormat "%h %l %u %t \"%r\" %>s %b" '''common'''<br>
LogFormat &quot;%{Referer}i -&gt; %U&quot; '''referer'''&lt;br&gt;
LogFormat "%{Referer}i -> %U" '''referer'''<br>
LogFormat &quot;%{User-agent}i&quot; '''agent'''
LogFormat "%{User-agent}i" '''agent'''
|}  
|}  


Each format string ends with a name (combined, common, referer and agent). These are short cuts containing the corresponding format string. You use this name as the second parameter for each custom log.
Each format string ends with a name (combined, common, referer and agent). These are short cuts containing the corresponding format string. You use this name as the second parameter for each custom log.


{| cellpadding=&quot;8&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;
{| cellpadding="8" cellspacing="1" style="background:#000000;"
|style=&quot;background:#f5f5f5;&quot;|
|style="background:#f5f5f5;"|
ErrorLog logs/name_error.log&lt;br&gt;
ErrorLog logs/name_error.log<br>
CustomLog logs/name_custom.log '''combined'''
CustomLog logs/name_custom.log '''combined'''
|}
|}
Line 55: Line 54:
Alternatively you can us a format string directly:
Alternatively you can us a format string directly:


{| cellpadding=&quot;8&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;
{| cellpadding="8" cellspacing="1" style="background:#000000;"
|style=&quot;background:#f5f5f5;&quot;|
|style="background:#f5f5f5;"|
ErrorLog logs/name_error.log&lt;br&gt;
ErrorLog logs/name_error.log<br>
CustomLog logs/name_custom.log '''&quot;%h % %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot;'''
CustomLog logs/name_custom.log '''"%h % %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""'''
|}
|}


Line 65: Line 64:
Using example sites taken from this page [[Virtual Hosting: Name based|Virtual Hosting - Name based]]:
Using example sites taken from this page [[Virtual Hosting: Name based|Virtual Hosting - Name based]]:


{|cellpadding=&quot;4&quot;
{|cellpadding="4"
|-style=&quot;background:#cccccc&quot;
|-style="background:#cccccc"
!Name:
!Name:
!Path to DoucumentRoot
!Path to DoucumentRoot
!Optional additions
!Optional additions
|-valign=&quot;top&quot; style=&quot;background:#f8f8f8&quot;
|-valign="top" style="background:#f8f8f8"
|www.my_site1.fredtest.mine.nu
|www.my_site1.fredtest.mine.nu
|I:/site1  
|I:/site1  
|ErrorLog logs/site1_error.log
|ErrorLog logs/site1_error.log
CustomLog logs/site1_custom.log combined
CustomLog logs/site1_custom.log combined
|-valign=&quot;top&quot; style=&quot;background:#f8f8f8&quot;
|-valign="top" style="background:#f8f8f8"
|www.my_site2.fredtest.mine.nu
|www.my_site2.fredtest.mine.nu
|/z_www/site2
|/z_www/site2
|ErrorLog logs/site2_error.log
|ErrorLog logs/site2_error.log
CustomLog logs/site2_custom.log combined
CustomLog logs/site2_custom.log combined
|-valign=&quot;top&quot; style=&quot;background:#f8f8f8&quot;
|-valign="top" style="background:#f8f8f8"
|www.ric.com
|www.ric.com
|/z_www/site3  
|/z_www/site3  
Line 89: Line 88:
Open the file '''httpd.conf''' located in folder '''*\Uniform Server\udrive\usr\local\apache2\conf''' . The virtual host entries are added to the end of this file.
Open the file '''httpd.conf''' located in folder '''*\Uniform Server\udrive\usr\local\apache2\conf''' . The virtual host entries are added to the end of this file.


The first line NameVirtualHost * enables Apache for virtual host operation. If you comment out this line by adding &quot;#&quot; it disables all the hosts you have configured.
The first line NameVirtualHost * enables Apache for virtual host operation. If you comment out this line by adding "#" it disables all the hosts you have configured.


'''''Note 1'':'''&lt;br&gt;Each section now contains the appropriate log directives. Apache will automatically create the log files (in folder *\Uniform Server\udrive\usr\local\apache2\logs) when each site is accessed or when an error is produced.
'''''Note 1'':'''<br>Each section now contains the appropriate log directives. Apache will automatically create the log files (in folder *\Uniform Server\udrive\usr\local\apache2\logs) when each site is accessed or when an error is produced.


'''''Note 2'':'''&lt;br&gt;If Apache does not need to write to a file, it is not created.
'''''Note 2'':'''<br>If Apache does not need to write to a file, it is not created.


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
== Important notes ==
== Important notes ==
'''''Note 1'':'''&lt;br&gt;The program automatically un-comments the line '''NameVirtualHost *''' . If you have previously used virtual hosts and decide to run the server with no virtual hosts you must manually re-insert this comment.
'''''Note 1'':'''<br>The program automatically un-comments the line '''NameVirtualHost *''' . If you have previously used virtual hosts and decide to run the server with no virtual hosts you must manually re-insert this comment.


# Open file: '''httpd.conf'''
# Open file: '''httpd.conf'''
Line 105: Line 104:
# Save file and '''restart server'''
# Save file and '''restart server'''


'''''Note 2'':'''&lt;br&gt;Not transportable
'''''Note 2'':'''<br>Not transportable


When you have created your virtual hosts, view your sites by typing the real web-site name into your browser address bar. For example www.mpgautos.com will serve pages from the site1 folder. If you copy Uniform Server and your sites to a memory stick, do not be surprised if they no longer work when run on a different machine. You need to copy the Windows hosts entries to the machine you are running on. However if this is inconvenient then this link may help [[Virtual Hosting: PAC|Virtual Hosting &amp; PAC]].
When you have created your virtual hosts, view your sites by typing the real web-site name into your browser address bar. For example www.mpgautos.com will serve pages from the site1 folder. If you copy Uniform Server and your sites to a memory stick, do not be surprised if they no longer work when run on a different machine. You need to copy the Windows hosts entries to the machine you are running on. However if this is inconvenient then this link may help [[Virtual Hosting: PAC|Virtual Hosting & PAC]].


'''''Note 3'':'''&lt;br&gt;Common problems
'''''Note 3'':'''<br>Common problems


*If you find the servers no longer run after creating a Vhost with separate logs, make sure you have included a second parameter for the custom log.
*If you find the servers no longer run after creating a Vhost with separate logs, make sure you have included a second parameter for the custom log.