Jump to content
Sign in to follow this  
Philmau

Personal web server fails after time machine restore.

Recommended Posts

I hope someone might be able to help me, I recently upgraded my powerbook HD and used Time Machine to restore the system. It all seemed to work (besides some permissions issues), however now I am unable to view my local websites (in ~User/Sites/ folder) or any of the apache services by entering my local IP in safari. Safari fails to connect with the error "can't find host".

This feature is very usefull as I use it for web development to preview my websites, I guess something was corrupted or not written during the restore.

I feel I have tried everything I know, I have repaired permissions, reinstalled the latest combo update and used another account but no luck. This is not a hardware issue as it works with an external install of 10.5.5.

 

Any suggestions welcome, otherwise it looks like a full re-install of osx.

Share this post


Link to post
Share on other sites

Check Ssytem Preferences / Sharing to make sure Web Sharing is still enabled.

 

Check System Preferences / Firewall to make sure Web Sharing is open.

 

Note you can usually use 127.0.0.1 for your machine's local IP.

 

Check the Apache server log (in /var/log/apache2/error_log and access_log). In Terminal "sudo tail -100 /var/log/apache2/error_log" to look for error reports.

Edited by car1son

Share this post


Link to post
Share on other sites

Or you could switch to MAMP. IT's what we (well, I do anyway) use at work for web development. Less messing about with core OS files when you're messing about with config settings, the ability to switch between php4 and php5 with a dropdown menu etc etc.

Share this post


Link to post
Share on other sites

Thanks guys,

car1son: websharing and firewall are both ok, I tried using 127.0.0.1 but no luck and it seems there is no apache log in /var/log/ ?? thanks for the advice though.

 

Graham: I'l look into using MAMP, sounds like a good solution thanks.

Share this post


Link to post
Share on other sites
car1son: websharing and firewall are both ok, I tried using 127.0.0.1 but no luck and it seems there is no apache log in /var/log/ ?? thanks for the advice though.

If you still want to poke around with Apache... I wonder if your WebServer is really running?

 

The Terminal command:

ps -alx | grep httpd

should show some httpd (apache) processes:

[HiMac:~] user% ps -alx | grep httpd
   0  4666     1       4   0  31  0  2702080   2332 -      Ss   93f7060 ??         0:00.13 httpd
  70  4667  4666     104   0  31  0  2702080    680 -      S    93f9310 ??         0:00.00 httpd
   0  4727     1    4004   0  31  0  2701044   3848 -      Ss   93f8c20 ??         0:00.16 /usr/sbin/httpd -D FOREGROUND
  70  4731  4727     104   0  31  0  2701044    684 -      S    6bf12b0 ??         0:00.00 /usr/sbin/httpd -D FOREGROUND
 501  4771  4761    4002   0  31  0   599820    468 -      S+   93f5940 ttys003    0:00.00 grep httpd
[HiMac:~] user% 

If not, then apache isn't running.

 

In addition, lsof should show httpd listening on port 80. "lsof | grep httpd | grep TCP" is a good way to find that, but you'll need to be logged in as root via "sudo -s" for lsof to work.

sudo -s
bash-3.2# lsof | grep httpd | grep TCP
httpd     4666           root    4u     IPv4 0xde5ae64        0t0       TCP *:8080 (LISTEN)
httpd     4667           _www    4u     IPv4 0xde5ae64        0t0       TCP *:8080 (LISTEN)
httpd     4727           root    3u     IPv6 0x69944bc        0t0       TCP *:8080 (LISTEN)
httpd     4727           root    4u     IPv4 0xa880a68        0t0       TCP *:* (CLOSED)
httpd     4731           _www    3u     IPv6 0x69944bc        0t0       TCP *:8080 (LISTEN)
httpd     4731           _www    4u     IPv4 0xa880a68        0t0       TCP *:* (CLOSED)
bash-3.2# 

(Note, my WebServer listens on port 8080 instead of 80 because I edited /etc/apache2/httpd.config to make it 8080.)

 

The webserver (apache) logs by default go into /var/log/apache2, but that location can be changed in the file /etc/apache2/httpd.conf file, if you've customized it.

Share this post


Link to post
Share on other sites

Thanks for all your help, I actually decided to cut my losses and since I still have the old drive I SuperDuper'd the old drive to the new one, time machine helped recover any files from the past couple of days.

So now I'm back where I was two days ago but it all works at least, I still wish I knew what the cause of the problem was though...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online

×