You are not logged in.
Good Evening!
I just installed Apache HTTP Server everything was working as expected but after a while, it stopped picking up the newly created file in "/srv/http" when I visit "localhost". It opens the first file in the browser that created in /srv/http.
What I don't understand is that the DocumentRoot and Directory are looking at "/srv/http" in /etc/httpd/conf/httpd.con file.
The configuration is like:
DocumentRoot "/srv/http"
<Directory "/srv/http">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>Last edited by e11i0t (2019-11-11 07:13:21)
Offline
Are you sure that it's not just your browser showing a cached version of the page? Can you force-refresh the page (usually ctrl+F5)?
Offline
I force refreshed it and I even reboot my system. But it still showing a page that doesn't even exist.
Offline
Hey,
I don't know much about apache, but you should be able to have a look in the logs to see which file it tries to access, you might have to set a different loglevel in the configuration.
Here are some resources about apache logging:
- Apache Logging Basics
- The official apache documentation on logs
If that does not work, here is another quick way of seeing which file apache is accessing: you can use strace to have a look at which file your apache process is accessing, i don't have apache on hands so i'll use nginx but the process is the same:
1) i find the PID of the process:
root@potato ~ # ps aux | grep nginx
root 7714 0.0 0.1 7452 668 ? Ss 08:53 0:00 nginx: master process /usr/bin/nginx -g pid /run/nginx.pid; error_log stderr;
http 7715 0.0 0.6 8672 2636 ? S 08:53 0:00 nginx: worker process2) I attach strace to the worker process and i see it accessing the files, along other stuff, it does a lot of stuff, you can make it show you only file access or just save to a file the whole thing and grep/search inside the name of your file:
root@potato ~ # strace -p 7715
.................
stat64("/srv/http/krkrkrss/index.html", {st_mode=S_IFREG|0644, st_size=2407, ...}) = 0
openat(AT_FDCWD, "/srv/http/krkrkrss/index.html", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 10
..................Here is refreshed my page while having strace attached to nginx, and i saw nginx accessing that index page.
Carefully explaining your problem is half the solution.
Offline
It seems like Apache was not properly installed. I reinstalled it and created a separate ~/public_html directory, and now it's working fine!
Offline