Stu>*off. I know nothing about Linux. About all I know is to read
Stu> and change directories and start up Xwindows. I friend of a
Stu> friend asked me if I could change the passwords to his Linux box,
Stu> which I did.
Stu> BTW: Is there a way to keep the listing from rolling off the top
Stu> of the screen when you use ls or ls -l? Something like the /p
Stu> switch in DOS?
You can pipe ls into a pager:
ls -l | less
ls -l | more
Cntrl-c will stop more and get you back to the prompt; for less "q"
will exit it.
You might want to look into using emacs for file browsing. Cntrl-D
will list a directory, and then you can search with in it, change
permissions, edit files and enter sub-directories with a single
keystroke -- look at the tutorials and help for emacs or send me email
for a short overview.
Stu> Here's the problem. Hopefully someone knows the answer or can at
Stu> least point me somewhere to look for it.
Stu> When he updates his web site he does it on a Mac and then copies
Stu> the files over to the Linux server using a CD (no floppy on the
Stu> Mac!?). When we tested this we just tried overwriting one
Stu> file(contacts.html) and it looks fine when viewed from the Linux
Stu> box. When viewed over the internet the old contacts.html still
Stu> shows up.
Stu> We're sure we overwrote the old file and the letter case is
Stu> correct. We tried accessing it over the net from different
Stu> computers and refreshing the page but no change.
Stu> When I ping the website I get a "Request timed out". I thought
Stu> this meant the computer isn't there or accessable from the
Stu> internet. So where's the website coming from!!! I did shut down
Stu> and restart the Linux box just to be sure the web site actually
Stu> was being served from there.
The machine might respond to web requests on port 80 but not pings, it
depends on the firewall and network setup.
Stu> The only things I can think of is that the server is behind a
Stu> firewall? in which case I'm totally lost! Or the contacts.html
Stu> file we overwrote was the wrong one.
Stu> I looked through the directories using the Xwindows file manager
Stu> and only found the files for the website in one location. The
Stu> location was /home/httpd/photoxxxxx/*. photoxxxxx being the
Stu> domain name for the website. Is this the only place the web
Stu> server would look for the files? Is there some sort of cache on
Stu> the server?
Here is a command (which may take a while to run) which will find all
files named contacts.html on the machine:
find / -name contacts.html -print
Stu> The guy I'm doing this for says his ex employee used to just copy
Stu> the whole directory over to the server when he was updating the
Stu> website. Even if he was just updating one file. Could this have
Stu> something to do with it? Permissions or something? When I checked
Stu> the permissions for the photoxxxxx directory the user was 501 or
Stu> something like that. Even though there's no user 501 on the
Stu> system. That I could find.
If you look at /etc/passwd file, you should be able to see if there is
a user with userid 501.
Stu> He also says the guy did something after he copied the files over
Stu> but has no idea what it was. When I first turned on the monitor
Stu> it said something or other about apache and I had to hit Ctrl+z
Stu> to get to the prompt. Is apache the web server? Or a firewall?
Apache is the web server. Ctrl-z suspends a job, that is, "puts it in
the background" but stops it from running. Perhaps the command that
was running was "tail -f /var/log/access_log" or a tail -f of some
other log file. Tail will display the last few lines of a file, and
that -f will cause it to "follow" the file, i.e., display new stuff as
it is added to the file.
Stu> Man! I'm lost! Unfortunately, I don't have access to the computer
Stu> unless someone is there. Otherwise I'd keep at it till I figured
Stu> it out. Meanwhile, it's driving me crazy not knowing whats
Stu> wrong. Any pointers would be greatly appreciated!
Rebooting the computer should have fixed anything funky that you did
by cntrl-x, if that was an important process that was running. I'm
not sure what the problem is, but here are a few things to do to learn
more info once you can get back to the machine:
1) Confirm that apache is the web server. Running the command "ps
aux" should list all processes, you should see some named "httpd".
You can use the command "chkconfig --list" to see that the httpd
process is started at boot. Use the "What's that site running?"
query on netcraft.com (you can do this without being at the
machine). There is probably a script in /etc/rc.d/init.d/httpd
that starts up the web server. Look in this file and you can see
the actual command used to start the web server,
2) Find the apache log and configuration files. The configuration
file should be listed at the top of the /etc/rc.d/init.d/httpd
file, something like this:
# pidfile: /var/run/httpd.pid
# config: /etc/httpd/conf/access.conf
# config: /etc/httpd/conf/httpd.conf
# config: /etc/httpd/conf/srm.conf
Look in those files, and you will see the log files for apache
listed. There is usually an error log and an access log. Look at
those. They will probably be in /var/log/httpd, but they can be in
A final log file to examine is the general one, /var/log/messages.
Hopefully somewhere in those you should find some clues; if it isn't
obvious what's going on post the new info here.