Debugging Tips: Difference between revisions
m
Reverted edits by Upazixorys (Talk); changed back to last version by Doug
Upazixorys (talk | contribs) No edit summary |
m (Reverted edits by Upazixorys (Talk); changed back to last version by Doug) |
||
Line 1: | Line 1: | ||
<span id="top"></span> | |||
< | <div style="padding:0;margin:0; border-bottom:3px inset #000000"> | ||
</ | |||
{| | {| | ||
| [[Image:uc_small_logo.gif | MPG UniCenter]] || | | [[Image:uc_small_logo.gif | MPG UniCenter]] || | ||
Debugging Tips | Debugging Tips | ||
|} | |} | ||
</div> | |||
{| cellpadding= | {| cellpadding="2" | ||
| | | | ||
__TOC__ | __TOC__ | ||
Line 39: | Line 31: | ||
# Select '''Text and Web''' top menu bar ('''''Automatically selected''''' for you) | # Select '''Text and Web''' top menu bar ('''''Automatically selected''''' for you) | ||
# Bottom of page you will find a text field '''Translate a web page''' enter a valid address for your page: | # Bottom of page you will find a text field '''Translate a web page''' enter a valid address for your page: | ||
## It accepts IP addresses for example | ## It accepts IP addresses for example <nowiki>http://89.007.251.102/test/index.html</nowiki> | ||
## Or domain names for example: | ## Or domain names for example: <nowiki>http://fred.com/test/index.html</nowiki> | ||
# Select any language from the drop down list. | # Select any language from the drop down list. | ||
# Click Translate | # Click Translate | ||
Line 53: | Line 45: | ||
If you have made changes to Apache configuration file '''''httpd.conf''''' and find Apache no longer runs the chances are you made a typo? Apache will not run if there is a syntax error in the configuration file however the virtual drive (default '''W''') may have been created if so you can use the following to check for syntax errors: | If you have made changes to Apache configuration file '''''httpd.conf''''' and find Apache no longer runs the chances are you made a typo? Apache will not run if there is a syntax error in the configuration file however the virtual drive (default '''W''') may have been created if so you can use the following to check for syntax errors: | ||
Open a command prompt ('''run''' | Open a command prompt ('''run''' > type '''cmd''' > click '''Ok''') | ||
<table border="0" cellpadding="0" cellspacing="0"> | |||
<tr> | |||
<td> | |||
<table border="0" cellpadding="4" cellspacing="1" style="background:#000000"> | |||
<tr> | |||
<td bgcolor="#e8e8e8"> | |||
'''& | ''' In the pop-up window type the following shown in bold: ''' | ||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#f5f5f5"> | |||
C:\Documents and Settings\fred | C:\Documents and Settings\fred>'''w:'''<br> | ||
W:\ | W:\>'''cd usr\local\apache2\bin'''<br> | ||
W:\usr\local\apache2\bin | W:\usr\local\apache2\bin>'''apache.exe -t'''<br> | ||
Syntax OK | Syntax OK | ||
W:\usr\local\apache2\bin | W:\usr\local\apache2\bin> | ||
</td> | |||
</tr> | |||
</table> | |||
</td> | |||
<td width="10"> </td> | |||
<td width="100%"> | |||
This will run Apache and check the configuration syntax. | This will run Apache and check the configuration syntax. | ||
Line 85: | Line 77: | ||
*'''apache.exe -t''' Runs Apache with test flag -t | *'''apache.exe -t''' Runs Apache with test flag -t | ||
</td> | |||
</tr> | |||
</table> | |||
Any syntax errors will be reported. | Any syntax errors will be reported. | ||
Line 98: | Line 90: | ||
Save the following to a file named '''uc_apache_syntax.bat''' place the file in folder '''Uniform Server''' double click to run. | Save the following to a file named '''uc_apache_syntax.bat''' place the file in folder '''Uniform Server''' double click to run. | ||
<pre> | |||
:Batch file to check Apache configuration syntax | :Batch file to check Apache configuration syntax | ||
:Creates a virtual drive if it does not already exist | :Creates a virtual drive if it does not already exist | ||
Line 114: | Line 106: | ||
:== create virtual disk and map folder udrive to it | :== create virtual disk and map folder udrive to it | ||
subst %Disk%: | subst %Disk%: "udrive" | ||
:== Clear screen hides error if already created | :== Clear screen hides error if already created | ||
Line 136: | Line 128: | ||
:NOTREMOVED | :NOTREMOVED | ||
echo. | echo. | ||
echo | echo "Disk has not been removed" | ||
goto :END | goto :END | ||
:REMOVE | :REMOVE | ||
echo. | echo. | ||
echo | echo "Disk removed" | ||
subst %Disk%: /d | subst %Disk%: /d | ||
Line 147: | Line 139: | ||
echo. | echo. | ||
pause | pause | ||
</pre> | |||
File details and notes: | File details and notes: | ||
<table border="0" cellpadding="0" cellspacing="0"> | |||
<tr> | |||
<td> | |||
<table border="0" cellpadding="4" cellspacing="1" style="background:#000000" width="500"> | |||
<tr> | |||
<td bgcolor="#e8e8e8"> | |||
<div style="text-align:center">'''file: uc_apache_syntax.bat'''</div> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#f5f5f5"> | |||
@echo off | @echo off | ||
<nowiki>:</nowiki>== Set drive to W change this as required<br> | |||
'''set Disk=W''' | '''set Disk=W''' | ||
<nowiki>:</nowiki>== create virtual disk and map folder udrive to it<br> | |||
subst %Disk%: | subst %Disk%: "udrive" | ||
<nowiki>:</nowiki>== Clear screen hides error if already created<br> | |||
cls | cls | ||
<nowiki>:</nowiki>== select drive, change to folder, run apache command,<br> | |||
%Disk%: | %Disk%: | ||
Line 179: | Line 171: | ||
'''apache.exe -t''' | '''apache.exe -t''' | ||
<nowiki>:</nowiki>== User option to remove virtual drive<br> | |||
echo. | echo.<br> | ||
echo. | echo.<br> | ||
SET remove_disk=N | SET remove_disk=N<br> | ||
SET /P remove_disk=Remove virtual drive %Disk% type Y or y press enter = | SET /P remove_disk=Remove virtual drive %Disk% type Y or y press enter =<br> | ||
IF %remove_disk%==N goto :NOTREMOVED | IF %remove_disk%==N goto :NOTREMOVED<br> | ||
IF %remove_disk%==Y goto :REMOVE | IF %remove_disk%==Y goto :REMOVE<br> | ||
IF %remove_disk%==y goto :REMOVE | IF %remove_disk%==y goto :REMOVE<br> | ||
<nowiki>:</nowiki>NOTREMOVED<br> | |||
echo. | echo.<br> | ||
echo | echo "Disk has not been removed"<br> | ||
goto :END | goto :END | ||
<nowiki>:</nowiki>REMOVE<br> | |||
echo. | echo.<br> | ||
echo | echo "Disk removed"<br> | ||
subst %Disk%: /d | subst %Disk%: /d<br> | ||
<nowiki>:</nowiki>END<br> | |||
echo. | echo.<br> | ||
pause | pause | ||
</td> | |||
</tr> | |||
</table> | |||
</td> | |||
<td width="10"> </td> | |||
<td valign="top"> | |||
'''''Notes:''''' | '''''Notes:''''' | ||
Line 222: | Line 214: | ||
Hence these lines are required in the batch file they change the working disk and directory: | Hence these lines are required in the batch file they change the working disk and directory: | ||
:'''%Disk%:''' | :'''%Disk%:'''<br> | ||
:'''cd usr\local\apache2\bin''' | :'''cd usr\local\apache2\bin''' | ||
Line 231: | Line 223: | ||
* If you are performing a syntax check without running the servers then delete the virtual drive otherwise the servers will not start when using Server_Start.bat | * If you are performing a syntax check without running the servers then delete the virtual drive otherwise the servers will not start when using Server_Start.bat | ||
</td> | |||
</tr> | |||
</table> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 248: | Line 240: | ||
Logs all Mod Rewrite transactions to a file using “RewriteLog” and “RewriteLogLevel” directives. These instructions cannot be placed in an htaccess file they must be placed in Apache’s main configuration file httpd.conf preferably in a Vhost. | Logs all Mod Rewrite transactions to a file using “RewriteLog” and “RewriteLogLevel” directives. These instructions cannot be placed in an htaccess file they must be placed in Apache’s main configuration file httpd.conf preferably in a Vhost. | ||
<table border="0" cellpadding="0" cellspacing="0"> | |||
<tr> | |||
<td> | |||
<table border="0" cellpadding="4" cellspacing="1" style="background:#000000" width="450"> | |||
<tr> | |||
<td bgcolor="#e8e8e8" > | |||
<div align="center">'''File: httpd.conf'''<br> | |||
'''Location: *Uniform Server\udrive\usr\local\apache2\conf''' | '''Location: *Uniform Server\udrive\usr\local\apache2\conf'''</div> | ||
</td> | |||
</tr> | |||
<tr> | |||
<td bgcolor="#f5f5f5"> | |||
NameVirtualHost * | NameVirtualHost *<br> | ||
<VirtualHost *><br> | |||
ServerName localhost:80 | ServerName localhost:80<br> | ||
DocumentRoot /www | DocumentRoot /www | ||
'''RewriteLog | '''RewriteLog "logs/rewrite.txt"'''<br> | ||
'''RewriteLogLevel 9''' | '''RewriteLogLevel 9''' | ||
</VirtualHost> | |||
</td> | |||
</tr> | |||
</table> | |||
</td> | |||
<td width="10"> </td> | |||
<td width="100%"> | |||
*'''RewriteLog:''' Sets the log file name to which the server logs all rewrite transactions.(use any name you like) | *'''RewriteLog:''' Sets the log file name to which the server logs all rewrite transactions.(use any name you like) | ||
*'''RewriteLogLevel:''' Sets the log level. Maximum log level is | *'''RewriteLogLevel:''' Sets the log level. Maximum log level is "9" will log almost all-rewriting transactions a setting of "0? will disable rewrite logging. Choose a value that best suits your needs, try a value of “3 or 5” | ||
*'''Note:''' The log file rewrite.log will be found in folder: *Uniform Server\udrive\usr\local\apache2\logs | *'''Note:''' The log file rewrite.log will be found in folder: *Uniform Server\udrive\usr\local\apache2\logs | ||
</td> | |||
</tr> | |||
</table> | |||
'''''Note:''''' Only enable these lines while testing do not use on a live server because logging will quickly eat your disk space. Comment out the lines (by placing # at the start of the line) or delete after testing, you may also wish to delete the log file (rewrite.txt). | '''''Note:''''' Only enable these lines while testing do not use on a live server because logging will quickly eat your disk space. Comment out the lines (by placing # at the start of the line) or delete after testing, you may also wish to delete the log file (rewrite.txt). | ||