well duh - Server not found

17 posts / 0 new
Last post
#1 Mon, 04/16/2012 - 12:30
webmin_d

well duh - Server not found

Hi all,

I know it's a dumb mistake somewhere, but I just cant get Apache to display virtualhost user domain files:

eg. user is tomjerry and url pointing to domain is http://tomjerry.localdomain
tomjerry account is created, everything is created but Apache just refuses to show anything for it - Server not found
http://localhost.localdomain shows the default "Apache on CentOS" page from /var/www/html
Restarted Apache, BIND, and even Webmin itself.

Please help!
davey

PS: webmin, virtualmin are awesome!!

Thu, 04/19/2012 - 19:07
webmin_d

I've tried various things in httpd.conf, but no use.

Seeing from here: https://www.virtualmin.com/node/21825 I get a doubt - is the Apache inside webmin/virtualmin different from the Apache installed by default in CentOS?

Do I have to make symlinks anywhere?

Any help greatly appreciated. dave

Fri, 04/20/2012 - 02:55
ronald
ronald's picture

Did you install virtualmin through the install.sh ? do you see /home/tomjerry and does it contain the necessary files and folders like public_html ?
Did you use virtualmin to create the domain tomjerry ?

Fri, 04/20/2012 - 06:04
Locutus

What's in the Apache logs? First thing to check in case of problems with Linux stuff is always the logs.

Fri, 04/20/2012 - 10:22
webmin_d

Thanks for the replies !!

  • manually installed virtualmin as i had already installed webmin - downloaded the rpm, installed it, found the wbm of virtualmin in the modules list, then installed from there.

  • /home/tomjerry has all of the needed folders and files for a virtual account - like .bashrc, pubic_html, mail account, etc

  • yes, used virtualmin to create user tomjerry.

Is there something to be done in httpd.conf - like adding NameVirtualHost ,
or,
do we have to add the domains in /etc/hosts or something?

My /etc/hosts contains this:

127.0.0.1 test1.local localhost test1  
::1 localhost.localdomain localhost6 localhost test1  

My /etc/httpd/conf contains this:

[dave@test1 ~]$ grep -iRnH 'virtual' /etc/httpd/conf
/etc/httpd/conf/httpd.conf:903:NameVirtualHost *  
/etc/httpd/conf/httpd.conf:904:NameVirtualHost 192.168.1.5:80  
/etc/httpd/conf/httpd.conf:980:#NameVirtualHost *:80  
/etc/httpd/conf/httpd.conf:1002:<VirtualHost 192.168.1.5:80>  
/etc/httpd/conf/httpd.conf:1008:ErrorLog /var/log/virtualmin/subdom1.localdomain_error_log  
/etc/httpd/conf/httpd.conf:1009:CustomLog /var/log/virtualmin/subdom1.localdomain_access_log combined  
/etc/httpd/conf/httpd.conf:1025:</VirtualHost>  
/etc/httpd/conf/httpd.conf:1026:<VirtualHost 192.168.1.5:80>  
/etc/httpd/conf/httpd.conf:1032:ErrorLog /var/log/virtualmin/subdom2_error_log  
/etc/httpd/conf/httpd.conf:1033:CustomLog /var/log/virtualmin/subdom2_access_log combined  
/etc/httpd/conf/httpd.conf:1049:</VirtualHost>  
/etc/httpd/conf/httpd.conf:1050:<VirtualHost 192.168.1.5:80>  
/etc/httpd/conf/httpd.conf:1056:ErrorLog /var/log/virtualmin/tomjerry.localdomain_error_log  
/etc/httpd/conf/httpd.conf:1057:CustomLog /var/log/virtualmin/tomjerry.localdomain_access_log combined  
/etc/httpd/conf/httpd.conf:1073:</VirtualHost>  

Errors from /var/log/dave.local-error_log

[Mon Apr 16 21:43:26 2012] [error] [client 127.0.0.1] (13)Permission denied: access to / denied  
[Mon Apr 16 21:53:23 2012] [error] [client 127.0.0.1] (13)Permission denied: access to /index.html denied  
[Mon Apr 16 22:04:34 2012] [error] [client 127.0.0.1] (13)Permission denied: access to /~dave denied  

Some more errors (only unique entries, there are several repeats...) from
/var/log/error_log

[Mon Apr 16 22:36:12 2012] [warn] NameVirtualHost *:0 has no VirtualHosts  
[Mon Apr 16 22:36:12 2012] [notice] Digest: generating secret for digest authentication ...  
[Mon Apr 16 22:36:12 2012] [notice] Digest: done  
[Mon Apr 16 22:36:13 2012] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.0-fips SVN/1.6.11 configured -- resuming normal operations  

[Mon Apr 16 22:59:57 2012] [error] avahi_entry_group_add_service_strlst("subdom2") failed: Invalid host name  
[Mon Apr 16 22:59:57 2012] [error] avahi_entry_group_add_service_strlst("localhost") failed: Invalid host name  
[Mon Apr 16 23:00:58 2012] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/  
[Mon Apr 16 23:00:58 2012] [error] [client 127.0.0.1] File does not exist: /var/www/html/favicon.ico  
[Mon Apr 16 23:00:58 2012] [error] [client 127.0.0.1] script not found or unable to stat: /var/www/cgi-bin/missing_handler.pl  

[Mon Apr 16 22:31:36 2012] [error] [client 127.0.0.1] File does not exist: /var/www/html/~joe  
[Mon Apr 16 22:31:36 2012] [error] [client 127.0.0.1] script not found or unable to stat: /var/www/cgi-bin/missing_handler.pl  

And the following are blank:

/var/log/virtualmin/subdom1.localdomain_error_log
/var/log/virtualmin/subdom1.localdomain_access_log
/var/log/virtualmin/subdom2_error_log
/var/log/virtualmin/subdom2_access_log
/var/log/virtualmin/tomjerry.localdomain_error_log
/var/log/virtualmin/tomjerry.localdomain_access_log
Fri, 04/20/2012 - 11:20
ronald
ronald's picture

I think your problem is the manual installation of virtualmin.
Virtualmin normally installs suexec which looks like you dont have.
What you can try is remove apache and then install it again but make sure you have the virtualmin repositories in /etc/yum.repos.d
it is a file called virtualmin.repo and the contents for a centos 6.2 server is

[virtualmin]
name=RHEL/CentOS/Scientific $releasever - $basearch - Virtualmin
baseurl=http://SERIALNUMBER:LICENSEKEY@software.virtualmin.com/gpl/rhel/$releasever/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-virtualmin
gpgcheck=1
 
[virtualmin-universal]
name=Virtualmin Distribution Neutral Packages
baseurl=http://SERIALNUMBER:LICENSEKEY@software.virtualmin.com/gpl/universal/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-virtualmin
gpgcheck=1

edit:
It could be that apache was compiled with suexec and that you need to load the module only in the httpd.conf
LoadModule suexec_module modules/mod_suexec.so
If not you will need a new apache compiled with suexec and that is described above.

Fri, 04/20/2012 - 11:54
webmin_d

The error log is full of this notice:

[root@test1 dave]# grep -iRnH 'suexec' /etc/httpd/
/etc/httpd/logs/error_log:109:[Mon Apr 16 22:08:18 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
/etc/httpd/logs/error_log:115:[Mon Apr 16 22:08:38 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
/etc/httpd/logs/error_log:162:[Mon Apr 16 22:59:55 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
...

and this result too:

/etc/httpd/conf/httpd.conf:198:LoadModule suexec_module modules/mod_suexec.so
Fri, 04/20/2012 - 12:00
webmin_d
[root@test1 dave]# ls -hal /etc/yum.repos.d/
total 56K
drwxr-xr-x.   2 root root 4.0K Apr 17 22:43 .
drwxr-xr-x. 114 root root  12K Apr 20 22:02 ..
-rw-r--r--.   1 root root 1.9K Dec  9 08:35 CentOS-Base.repo
-rw-r--r--.   1 root root  637 Dec  9 08:35 CentOS-Debuginfo.repo
-rw-r--r--.   1 root root  626 Dec  9 08:35 CentOS-Media.repo
-rw-r--r--.   1 root root  957 Oct 12  2010 epel.repo
-rw-r--r--.   1 root root 1.1K Oct 12  2010 epel-testing.repo
-rw-r--r--    1 root root  739 Nov 13  2010 mirrors-rpmforge
-rw-r--r--    1 root root  717 Nov 13  2010 mirrors-rpmforge-extras
-rw-r--r--    1 root root  728 Nov 13  2010 mirrors-rpmforge-testing
-rw-r--r--    1 root root 1.1K Nov 13  2010 rpmforge.repo
-rw-r--r--    1 root root  163 Apr 16 16:40 webmin.repo
[root@test1 dave]# cat /etc/yum.repos.d/webmin.repo
[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1
[root@test1 dave]#

If I have to do a full reinstall, which is the best way to do it? This would mean I need to do a clean un-install.

I have to first remove whatever is already added, but I defintely do not want to remove my current linux user (dave). And there is also a lot of development data on this machine so a clean wipe and reinstall of the machine is nearly out of question for me at the moment.

Fri, 04/20/2012 - 13:14
andreychek

Howdy,

The problems you're having do appear to be related to your manual install, the automated installer sets that all up for you.

But, a clean install in order to use that automated installer implies formatting, and reinstalling your operating system.

You can continue with a manual install of Virtualmin, though doing may be some work :-)

There are instructions for doing a manual install here, you may wish to review the instructions:

http://www.virtualmin.com/documentation/installation/manual

I'd also recommend disabling any software repositories outside of the CentOS and Virtualmin repositories, as those would just further complicate things :-)

You may also want to comment out the "NameVirtualHost *" entry in your httpd.conf, as you only need the "NameVirtualHost 192.168.1.5:80" entry.

I'd also suggest grabbing the version of Apache provided by Virtualmin, as Ronald had mentioned.

-Eric

Fri, 04/20/2012 - 22:28
webmin_d

OK I went through the manual install steps and I find that there are a lot of steps where things can fail. So I wisen up / chicken out and decide to go the install.sh way.

Now when I have removed httpd, bind, mysql, php, from my system, what would I have to remove before the system becomes "clean" enough to run install.sh

I'll delete all the user accounts, subdom1, subdom2, tomjerry etc using "userdel"

Then, I remove both webmin.repo and virtualmin.repo

I need EPEL and Rpmforge because I have some programs I use - this is not a production server, obviously but a development+test server on a local network, so security-wise I dont think I have to worry much.

Then I download and run the install.sh, right?

Or do I really have to install a fresh copy to a new partition and dual-boot (only option left)

Thanks in advance.

All of you have been very helpful and I appreciate that.

I just wish I knew a few days earlier about the better way to install - I initially thought that webmin was more than enough as a control panel. Virtualmin is far trickier to install manually.

Thanks again!

Fri, 04/20/2012 - 22:59
andreychek

Howdy,

Well, unfortunately, it's really not possible to do a "clean" install without formatting and starting over.

Non-standard packages and config file changes can cause problems with your Virtualmin installation. And the RPMForge repository is known to contain packages that conflict with those provided by Virtualmin.

Now, you can of course try a Virtualmin install using the install.sh without formatting, but I'd expect to have to do some troubleshooting and extra work that wouldn't occur when working with a freshly installed distro.

Since RPMforge has packages that conflict with Virtualmin -- my recommendation would be to configure that repository to only pull down the packages you need, rather than allowing all packages to be installed.

It sounds like you took some good first steps though, by removing packages that would be likely to be troublesome... my suggestion would be to completely disable the RPMForge and EPEL repositories during the Virtualmin installation, and then afterwards, re-enable them and configure them to just pull down the packages you need from those repos by specifying your desired packages in the "includepkgs=" option in the .repo file.

-Eric

Sat, 04/21/2012 - 01:37
webmin_d

Thanks a ton folks!

andreychek, I took your advice and removed everything from Rpmforge, EPEL, webmin, virtualmin, then removed all the repos, then ran the install script.

Installed smoothly!

Now let's hope no hidden nasties come up later.

Sat, 04/21/2012 - 02:37
webmin_d

Well, almost everything is perfect ;-) because I got this message in bold:

Default IP address is set to 192.168.1.3, but the detected external address is actually x.x.x.x. This is typically the result of being behind a NAT firewall, and should be corrected on the module configuration page.

Any pointers as to how to fix it ?

I know this sounds like complete spoon-feeding but I had earlier (another install) tried a bunch of entries the "setup" utility as well as /etc/hosts, but I couldnt get the "NAT" issue resovled to make x.x.x.x my machine's IP.

Thanks again.

EDIT:

Same old problem. Server Not found.

Everything else is fine - all servers running - everything shows perfect - no reported errors anywhere. And server not found.

At this point I think I am doing something as stupid as the old joke : Press Any Key - Where is the "Any" Key?

Now if only I can figure out where what my "any key" is!

Sat, 04/21/2012 - 05:52
ronald
ronald's picture

for the NAT thing you can go to virtualmin - System Settings - Virtualmin Configuration - Networking Settings.
Default virtual server IP address: would be your internal address
Default IP address for DNS records Would be your external address

Is apache now compiled with suexec /home ?
Do you see the suexec group in the httpd.conf - virtualhost container?
Below is an example

<VirtualHost xx.xx.xx.xx:80>
SuexecUserGroup "#747" "#632"
ServerName domain.info
DocumentRoot /home/domain.info/public_html
ErrorLog /home/domain.info/logs/error_log
CustomLog /home/domain.info/logs/access_log combined
ScriptAlias /cgi-bin/ /home/domain.info/cgi-bin/
ScriptAlias /awstats/ /home/domain.info/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/domain.info/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks +ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/domain.info/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/domain.info/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/domain.info/cgi-bin>
allow from all
</Directory>
RemoveHandler .php
RemoveHandler .php5
</VirtualHost>
Mon, 04/23/2012 - 10:53
webmin_d

Its not there.
Here's the diff
(file on Left: your config with my domain, IP values,
file on Right: value in my VirtualHost directive)

1 1 <VirtualHost 192.168.1.3:80>
2 _ - SuexecUserGroup "#747" "#632"
3 2 ServerName test.domain.org
_ 3 + ServerAlias www.test.domain.org
_ 4 + ServerAlias webmail.test.domain.org
_ 5 + ServerAlias admin.test.domain.org
4 6 DocumentRoot /home/test/public_html
5 _ - ErrorLog /home/test/logs/error_log
6 _ - CustomLog /home/test/logs/access_log combined
_ 7 + ErrorLog /var/log/virtualmin/test.domain.org_error_log
_ 8 + CustomLog /var/log/virtualmin/test.domain.org_access_log combined
7 9 ScriptAlias /cgi-bin/ /home/test/cgi-bin/
8 _ - ScriptAlias /awstats/ /home/domain.info/cgi-bin/
9 10 DirectoryIndex index.html index.htm index.php index.php4 index.php5
10 11 <Directory /home/test/public_html>
11 _ - Options Indexes IncludesNOEXEC FollowSymLinks +ExecCGI
_ 12 + Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
12 13 allow from all
13 14 AllowOverride All
14 15 AddHandler fcgid-script .php
15 16 AddHandler fcgid-script .php5
16 17 FCGIWrapper /home/test/fcgi-bin/php5.fcgi .php
17 18 FCGIWrapper /home/test/fcgi-bin/php5.fcgi .php5
18 19 </Directory>
19 20 <Directory /home/test/cgi-bin>
20 21 allow from all
21 22 </Directory>
_ 23 + RewriteEngine on
_ 24 + RewriteCond %{HTTP_HOST} =webmail.test.domain.org
_ 25 + RewriteRule ^(.\*) https://test.domain.org:20000/ [R]
_ 26 + RewriteCond %{HTTP_HOST} =admin.test.domain.org
_ 27 + RewriteRule ^(.\*) https://test.domain.org:10000/ [R]
22 28 RemoveHandler .php
23 29 RemoveHandler .php5
_ 30 + IPCCommTimeout 31
_ 31 + FcgidMaxRequestLen 1073741824
24 32 </VirtualHost>

Do I add it manually or from some virtualmin settings?

Mon, 04/23/2012 - 11:37
ronald
ronald's picture

so if you open a shell and type: httpd -V
you can see if your apache is compiled with suexec and thus coming from virtualmin repo
if that is the case you could try to go to Virtualmin - Server Configuration - Website Options and set PHP script execution mode to FCGId (run as virtual server owner)

Otherwise i think you still have the incorrect apache thus not from virtualmin repo

Mon, 04/23/2012 - 11:56
webmin_d
[dave@local ~]$ httpd -V
Server version: Apache/2.2.15 (Unix)
Server built:   Jan  5 2012 14:12:47
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

And here:

[root@local dave]# repoquery -i httpd

Name        : httpd
Version     : 2.2.15
Release     : 15.el6
Architecture: i386
Size        : 7189711
Packager    : None
Group       : System Environment/Daemons
URL         : http://httpd.apache.org/
Repository  : virtualmin
Summary     : Apache HTTP Server
Source      : httpd-2.2.15-15.el6.src.rpm
Description :
The Apache HTTP Server is a powerful, efficient, and extensible
web server.

Name        : httpd
Version     : 2.2.15
Release     : 15.el6.vm
Architecture: x86_64
Size        : 3067184
Packager    : None
Group       : System Environment/Daemons
URL         : http://httpd.apache.org/
Repository  : virtualmin
Summary     : Apache HTTP Server
Source      : httpd-2.2.15-15.el6.vm.src.rpm
Description :
The Apache HTTP Server is a powerful, efficient, and extensible
web server.

All this was installed by using install.sh after I yum-erase'd everything from all rerpos except the inital Centos ones.

And in website Options for the virtual server test.domain.org:
PHP script execution mode: FCGId (run as virtual server owner)

Right now I'm quite happy to try out the other options too:
Run CGI scripts as domain owner? Yes
.. and ..
PHP script execution mode: Apache mod_php (run as Apache's user)
PHP script execution mode: CGI wrapper (run as virtual server owner)

Wont manually adding the line for Suexec in < VirtualHost > work, although it may not be the right way to do it?

Thanks again for all the help!

Topic locked