Changes

From SME Server
Jump to navigationJump to search
2,869 bytes added ,  22:18, 7 February 2012
added Detailed generic troubleshooting & configuration steps
Line 228: Line 228:     
Finally, template fragments are processed alpha-numerically - so be sure that your customizations are inserted into the target config file in a sensible location.
 
Finally, template fragments are processed alpha-numerically - so be sure that your customizations are inserted into the target config file in a sensible location.
 +
 +
 +
===Detailed generic troubleshooting & configuration steps===
 +
 +
From http://forums.contribs.org/index.php/topic,48300.msg239719.html#msg239719
 +
 +
This article refers to modifying a wordpress installation, but can be applied to any installed web application.
 +
 +
Here is a process that can be followed when trying to reverse-engineer a situation with a template or db setting affecting a website:
 +
 +
 +
Edit /etc/httpd/conf/httpd.conf directly.
 +
 +
locate the area that needs to be changed
 +
 +
insert the required commands
 +
 +
restart the web server using
 +
sv t httpd-e-smith
 +
 +
test
 +
 +
If something is broken, then return to the start (by resetting defaults) using:
 +
expand-template /etc/httpd/conf/httpd.conf; sv t httpd-e-smith
 +
 +
If the problem is fixed by the temporary config file changes, then identify the template fragment that generates the section that needs to be modified:
 +
cd /etc/e-smith/templates/etc/httpd/conf/httpd.conf
 +
grep -ril <some text near temporary change> *
 +
 +
In the above grep command, replace <some text near temporary change> with the text you are looking for.
 +
 +
 +
Then examine the files listed to see if the required change can be made using a db variable, or made via a custom template fragment. You will need to have a moderate understanding of the template/fragment code to determine this, ask on the forum if unsure or read the Developers Manual.
 +
 +
 +
If nothing is returned, repeat the search in /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf.
 +
 +
If the required changes are not supported by using a db variable, then create a custom template fragment:
 +
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 +
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 +
cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/<TheFileINeedToCustomize> .
 +
(note the trailing space and dot at the end of the last line).
 +
 +
Now edit the "custom" template fragment created, and those contents will be used instead of the default template fragment used when the affected file (/etc/httpd/conf/httpd.conf) is generated using 'expand-template'.
 +
 +
After making the changes:
 +
expand-template /etc/httpd/conf/httpd.conf; sv t httpd-e-smith
 +
 +
If the changes have broken something:
 +
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 +
rm <TheFileINeedToCustomize>
 +
expand-template /etc/httpd/conf/httpd.conf; sv t httpd-e-smith
 +
 +
 +
It is also useful to create a file to display your PHP version information:
 +
 +
cd /path/to/wordpress
 +
(insert path to your application)
 +
echo '<?php phpinfo(); ?>
 +
' > pi.php
 +
 +
Now browse to http://wordpress.url/pi.php (or your applications URL) and you should get a long listing of detailed information about the specific PHP that is invoked when running php from your wordpress or application folder.
 +
 +
Having phpinfo() sitting around on your server may introduce a security risk, so remove the file when finished troubleshooting.
    
===References===
 
===References===
624

edits

Navigation menu