Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
While I am running about 12 different sites on the same machine (ZOneminder, Horde 4, A Wiki server, rssLounge, etc.) I am not using any VirtualHosts which I believe I should be using...
As of now, each "site" is located in /var/www/htdocs in its own subdirectory
To access these sites, I simply enter the server's IP followed by the site's folder. For example:
Code:
http://192.168.0.100/horde4/
which brings the Horde4 login page... So far, everything has worked flawlessly. I am not sure if its the right way to do things with Apache. As for newznab, it requires a VH which I tried to setup by modifying /etc/httpd/extra/httpd-vhosts.conf and adding
After saving the config files, running httpd restart and httpd -S (which says Syntax OK), I try to access the sites (for example rsslounge) and I get a 404 not found error page.
Apache's error log says:
Quote:
[Thu Dec 13 18:55:23 2012] [Error] [Client 192.168.0.105] File does not exist: /var/www/htdocs/newznab/www/rsslounge
Looks like whatever I am typing in the browser, Apache always look in the DocumentRoot of the first VirtualHost in the VH config file, and says that the folder is not there...
An IP... From any local machine, I type the server's IP followed by the site's folder. My server doesnt have to be accessible from outside (WAN). Only internal connection. Its not really a server in the technical sense since I am the only one using it...
lets say I want to access zoneminder's page, I will type
You will need a DNS entry pointing the HOST newzab to 192.168.0.100
You can do this in linux machines with /etc/hosts and adding a line
192.168.0.100 newzab
On windows machines you will need to edit the appropriate hosts file c:\windows\system32\drivers\etc\HOSTS http://en.wikipedia.org/wiki/Hosts_(file) has more details on locations of this file.
With the HTTP protocol what your browswer does is take the name newzab, convert it to an IP address (in this case 192.168.0.100) and then makes the request to that IP but says "by the way, I'm looking for site newzab" and apache will then go through your virtual hosts, match that to the ServerName and then use the appropriate document root. (Note to other posters - this is a simplistic explanation but it's close enough for this purpose!)
You can have multiple names for that IP so that in your hosts file you have:
to the /etc/hosts on the machine I am using to access the server OR on the server's /etc/hosts file????
Im comfortable using the server's IP for local browsing.. I admit its not good for public access but at the end of the day my server sits within my network and has no external access whatsoever.
The end result I am trying to achieve is:
From any machine connected to my network (therefore all having separate IP's), launch a web browser
Ok.. Ive tried everything. Messing around with the .htaccess files, the vhost config file, the general httpd.conf file, created symlinks, etc.. to no avail.
Overall, I have only 2 applications that are not working: rsslounge & newznab
1. rssLounge:
From a fresh start in /var/www/htdocs/rsslounge, I made sure the file ownership & permissions were all as per the installation instructions.
Then, I created a vhost in the apache's vhost config file with:
Quote:
<VirtualHost *:80>
ServerName rsslounge
DocumentRoot /var/www/htdocs/rsslounge
<Directory /var/www/htdocs/rsslounge>
AllowOverride All
ReWriteEngine On
</Directory>
</VirtualHost>
Then started Apache. No errors so far. When I access the site the same way I access the others that are working fine, I get a page without formatting and with no icons. Very far from what I should normally get. Apache complains it cant find some folders & files. From the logs:
Quote:
[Fri Dec 14 20:53:53 2012] [error] [client 192.168.0.106] File does not exist: /var/www/htdocs/rsslounge/favicon.ico
[Fri Dec 14 20:53:53 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/favicon.ico
[Fri Dec 14 20:54:00 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/javascript, referer: http://192.168.0.100/rsslounge/
[Fri Dec 14 20:54:00 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/stylesheets, referer: http://192.168.0.100/rsslounge/
[Fri Dec 14 20:54:00 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/favicon.ico
[Fri Dec 14 20:54:00 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/favicons, referer: http://192.168.0.100/rsslounge/
[Fri Dec 14 20:54:00 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/favicon.ico
[Fri Dec 14 20:54:12 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/javascript, referer: http://192.168.0.100/rsslounge/
[Fri Dec 14 20:54:12 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/stylesheets, referer: http://192.168.0.100/rsslounge/
[Fri Dec 14 20:54:12 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/favicon.ico
[Fri Dec 14 20:54:12 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/favicons, referer: http://192.168.0.100/rsslounge/
[Fri Dec 14 20:54:12 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/rsslounge/favicon.ico
So I started the insanity of creating symlinks so Apache can find what its looking for, but I ended up in an endless creation of symlinks and I gave up and deleted everything.
2. newznab:
Also from a clean install in /var/www/htdocs/newsnab, I made sure the file ownership & permissions were all as per the installation instructions.
Then, I created a vhost in the apache's vhost config file using the proposed vhost in their install file:
Quote:
<VirtualHost *:80>
<Directory /var/www/htdocs/newznab/www/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ServerName newznab
ServerAlias newznab
DocumentRoot /var/www/htdocs/newznab/www
</VirtualHost>
Restarted Apache, no errors in the config. Trying to access the application with http://server-ip/newznab returns
Quote:
Forbidden
You don't have permission to access /newznab/ on this server.
The requested URL /newznab/install was not found on this server.
Basically same as my previous posts...
Im a wits ends... I need an Apache expert! I crawled the web for hours nothing has helped so far.. Obviously, I dont understand how Apache works and as a result, I believe the redirects dont work.
Other symptom: when I access rsslounge's install page, I see a red error saying:
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
well the forbidden means that apache doesn't have permission to read the contents of the folder
the contents at the very minimum should be
chmod 644 (rw-r--r--) for files
and
chmod 755 (rwxr-xr-x) for folders
otherwise only the owner would be able to read the files
secondly i wouldn't use /var/www/htdocs as your document root, i would move everything into your home directory (eg /home/{user}/htdocs). yes you will have to chmod +x your home directory, but it would be at the very least easier to edit files you own instead of having to become root every time you want to change your website
I already had permissions set to 777 recursively on all files & folders within newznab but nevertheless, I changed permissions as you suggested and restarted apache. Unfortunately, did not helped
Added the quotes, removed the trailing slash, re-chmod'ed the newznab folder to 755 restarted apache, did httpd -S to verify the vhost config was OK which was, then tried to access newznab.
Same problem...
After further thoughts, I believe the access denied errors are normal for the root of newznab. In this folder, there are other folders that normally wouldnt have tp be accessed by people browsing the application (nzb files, the database, some text files, etc...
So the real error is the File not found error when I try to access /install
Quote:
[Sat Dec 15 10:05:32 2012] [error] [client 192.168.0.105] File does not exist: /var/www/htdocs/newznab/install
in my general httpd.conf, I already had two sections:
Quote:
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/srv/httpd/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
So I commented the first section, and I can access newznab root folder (NOT the DOCUMENT ROOT) (aka /var/www/htdocs/newznab) and I get a listing of the folder in my browser. Then if I try to access newznab/install I get a "Not found" browser error and apache says "File does not exist: /var/www/htdocs/newznab/install" in its logs.
However if I click on the www folder in the folder listing from my browser, I get the setup page I have been trying to get for so long... I noticed the address in the address bar is
To access named vhosts, you must be addressing the server by the relevant name.
If you use the IP, you are getting the default vhost.
You can also set port-based vhosts if you want to use IPort to get to your server, but the simplest way (as described above) is to add the hostnames to your DNS and address it by that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.