View Full Version : Totally fried my Server Apache Install - Help
blazingbiz
10-16-2006, 03:10 AM
Hi Group,
It started out uploading a php shopping cart script that needed to use Php 5, then I got into updating everything on my server using SSH.
At first things were going fine, I yummed my OS to the most updated, then installed Php 5, but the scripts wouldn't work so I decided to update to the latest version of Apache. I got some hang ups so I tried different how tos from the DA update forum, plus FAQ from my server provider. What ended up happening was that I installed multiple conflicting versions of Apache with multiple conf files, so now my web sites don't show up at all. Since I'm so deep into this I need a way of cleaning everything out for sure and installing one clean and properly confiured Apache 2.2.3 that has Php 5 working, without adding any more problems.
Your help in a step by step way of doing this is much appreciated.
Thanks
smtalk
10-16-2006, 07:10 AM
Contacted you at ICQ #179627253, but you are offline now.
blazingbiz
10-16-2006, 10:38 AM
I'll sign on to my IM in an hour, if I don't respond leave an IM message and I will get to it a little later. I have to an appointment coming in so I might not get to it right away.
Thanks
blazingbiz
10-16-2006, 02:40 PM
I'm a newbi and I tried to update my server which is running CentOS 4.1 to Php5 and Apache 2.2.3 I read and followed the instructions here in this forum with the ./ build commands and I also followed instructions on my hosting company's knowledgebase and another DA thread that essentially installed Php5 and Apache 2.2.3 manually the traditional way. I just followed both procedures and I did the manual way twice because my httpd wasn't showing up anymore.
I did the manual install of Php5 and the manual wget of apache-httpd2.2.3 using make and make install first, then the customapache ./ build methods, then the manual wget of apache-httpd2.2.3 using make and make install twice more because things were not working right.
Needless to say, my httpd is down and has been down since I did this. What is worse is that I cannot log in to my server now using SSH and putty, I get "Server unexpectedly refused connection" and then click ok and putty shows "inactive" and then shuts down.
Any suggestions about what to do at this point? Also if I get my server back up, how can I make sure I get Php5 and apache2.2.3 working right on my DA/CentOS server with the latest version of DA. I had just figured out that I needed to update my DA version before all this happened. I was running 1.23.6 I think. When I try to manually do this from the Admin CP, I got an error about my license not being valid. It expires every month along with my hosting payment billing cycle I think. How can take care of the updating of my license and DA version once my server and everything is back up?
I think the solution is to uninstall everything and clean out all my php and apache installs, then use the da customapache build script method to install everything correctly just once. If anyone can offer me the commands to do this I'd appreciate it. Also if I can get to upgrade to php5.1.6 and apache2.2.3 that would be great.
DamnSkippy
10-16-2006, 04:15 PM
My suggestions, if there is not anything on there you can not live without have the DC reimage the drive. Then hire someone to make the upgrades to the versions you want.
Make sure you watch some TV while the upgrades are being done ;)
blazingbiz
10-16-2006, 04:48 PM
I thought about that, but since everything on my server is fine except for apache and maybe the php config, that would definately be overkill.
Isn't there a way to uninstall packages in Linux, like an unmake command to clean everything out after installing a package file?
All I need is to undo the installs I made and clean out the config files of them, so I can start over with a clean server and DA without apache and php5 and then use the customapache build method outlined in the other thread to install everything and have it have the correct config.
After doing this yesterday, I figured out how to do it, the problem is that there are so many posts saying do it this way and do it that way and none of them really say don't do this if already did that and there isn't one clear way of doing it that is the standard as presented - that I did it a couple of ways and what happened is that my config is confused as to which one to implement and the lcoation of the files of the one httpd I want being used.
So the best way to fix that is to undo all of of what I did yesterday and do one method and go with that. The one that seems to be the default way to do it is the customapache build way.
blazingbiz
10-16-2006, 11:14 PM
Ok I redid the ./build in customapache and that got my apache up again, how do I point the www part to the location of my public_html to show my web pages?
Sounds like your /etc/httpd/conf/httpd.conf file may have been overwritten. See if a backup one exists there. If not, you may want to just do a
wget http://files.directadmin.com/services/customapache/httpd.conf -O /etc/httpd/conf/httpd.conf
cd /usr/local/directadmin/customapache
./build convert
That should get you a fresh httpd.conf and tell directadmin to convert it the Apache2 format.
blazingbiz
10-18-2006, 01:50 AM
Thanks for you help, so far I have the server up to 2.2.3 I did the configuration like you said to do. Now instead of the Apache home page I get a white page that says It Works!
Any ideas?
If this is your main page for the IP address, then you will need to make sure your DocumentRoot declared in /etc/httpd/conf/httpd.conf is pointing the correct directory (/var/www/html). If it is a named virtual host, then you need to make sure you have all the:
Include /usr/local/directadmin/data/users/${user}/httpd.conf
lines at the end of the conf file.
blazingbiz
10-18-2006, 02:46 PM
The includes are there and I changed the Doc root to the default "/var/www/html"
Still the It works page appears. I'm going to check the conf files the includes point to and see that says anything.
The includes should set the DocumentRoot for each named virtual host. I assume you restarted apache. The other thing that bites me every once in a while, is that an index.html(.[en|es|jp|...) will be used before an index.php or index.cgi. You might just be picking up the wrong start page.
blazingbiz
10-18-2006, 03:08 PM
I checked all the conf files, the main one and the user ones and they are all set up correctly pointing to the right places.
the includes are there in the main one.
Is there something I should check in the Virtual Host tags?
I am able to ftp to my site using Filezlla just fine, I don't think I have an index,html up on my main site.
I do restart and relaod my apache everytime I make changes.
Any ideas?
Try looking at your apache log files, and see where it is serving that file from. That should tell you where to look.
blazingbiz
10-18-2006, 03:43 PM
Ok I'm looking at my access_log in the /var/log/httpd/ directory what do I look for that would help me locate the fix for this?
thanks
I would look at your error_log file. If there is nothing in there, then try accessing your site and requesting a page that doesn't exist, (i.e. http://sitename/adfadfadf) then look in the error_log file for that request, it should say something similar to:
[Wed Oct 18 08:29:21 2006] [error] [client 64.4.8.136] File does not exist: /var/www/html/adfadfadf
And if that file is pointing to a path you did not set as your DocumentRoot, then I would start searching your conf files for that directory.
blazingbiz
10-18-2006, 03:57 PM
Thanks a lot this helps quite a bit. I went to my error log and these are the last three lines:
<pre>[Tue Oct 17 23:57:29 2006] [error] [client 66.249.65.234] File does not exist: /var/www/html/manual/mod/mod_log_config.html
[Tue Oct 17 23:57:29 2006] [warn] [client 66.249.65.234] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed
[Wed Oct 18 00:11:01 2006] [notice] caught SIGTERM, shutting down</pre>
Also the dates and time stamp is from last night and today early in the morning, I have been accessing my site later than that and no error log entires.
blazingbiz
10-18-2006, 04:01 PM
I did what you suggested with the page that doesn't exist. I got an 404 error page but no error log entry
Try looking in your /var/log/httpd/domains directory. Do a ls -ltr and look at the last error log file there. That is most likely the one you are hitting.
blazingbiz
10-18-2006, 05:06 PM
Hi I did that and I get a list of error logs the last two entries are the only two web sites I have on my server and the date is correct it has a bytes extension on them. Here is the out put:
-rw-r--r-- 1 root root 0 Oct 18 00:10 web-host-site.com.bytes
-rw-r--r-- 1 root root 0 Oct 18 00:10 mcgillteak.com.bytes
What can I do now?
I assume the web-host-site.com was the one that that you are having problems, since I just viewed the site. Try looking for the error log now, since I know I received a 404 error a minute ago.
blazingbiz
10-18-2006, 05:33 PM
Yes it is the same site.
I did the ls -ltr like you said to do in the other thread this was the out put:
I get a list of error logs the last two entries are the only two web sites I have on my server and the date is correct it has a bytes extension on them. Here is the out put:
-rw-r--r-- 1 root root 0 Oct 18 00:10 web-host-site.com.bytes
-rw-r--r-- 1 root root 0 Oct 18 00:10 mcgillteak.com.bytes
What now?
blazingbiz
10-18-2006, 05:42 PM
The last line of the error log says this:
caught SIGTERM, shutting down
there is nothing more afer that. The timestamp is [Wed Oct 18 00:11:01 2006] and that is earlier today but that is the last entry.
Any ideas at this point?
blazingbiz
10-18-2006, 06:03 PM
I checked the logs and seeing what is was from before it stopped working all of the paths are correct like when it was working.
Could it be the Virual Host function is off? How do I check that?
Also all of the error log entires stopped as of early this morning.
blazingbiz
10-18-2006, 09:18 PM
After updating my server I'm pretty sure there is something wrong with my virtual hosting settings.
I've attached a file here listing what is written to my httpd conf and include files as far as virtual hosting is related.
If I'm missing a file please let me know. If anyone sees anything wrong that needs to be changed please let me know.
blazingbiz
10-19-2006, 07:19 PM
The DA Support team helped me out and I got my server back up, thanks to them.
Now I'm back to the original problem I had before I screwed up my server. Php pages do not work, no matter waht - I upgraded to php-5.1.6 and editted the httpd.conf for apache2.0.59 that I'm on which is just the DO directive and nothing else. Also whenever I login to DA cp via the :2222 port I get the login screen and then login and get a blank white page.
blazingbiz
10-19-2006, 07:26 PM
BTW the reason my server would not show up last time was because of an install compile issue where -D HTTPD_ROOT="/usr/local/apache2"
was set and it should have been set to /etc/httpd fyi
blazingbiz
10-19-2006, 07:27 PM
Also before I upgraded to the php5 the same issue was happening with php4, php was not being processed at all - php info () was a blank white page.
As far as DA not letting you login, that is something I would work with DA support with. Try posting your whole httpd.conf file, perhaps you have something that still isn't configured properly. Are you still showing the SIGERM signals in your log files?
blazingbiz
10-19-2006, 09:22 PM
I uploaded my main httpd.conf file here, if anyone can see anything that needs changing.
Also, I did update my CentOS server to linux kernel.i686 2.6.9-42.0.3.EL I don't if that has to do with anything but the problems I'm having did start around that time.
I also uploaded my latest error_log to show what has been happening it says a lot, the Sig error appears as well and that snakeoil domain is not looking good.
Attached here is the httpd.conf file
blazingbiz
10-19-2006, 09:24 PM
Here is the error logs.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.