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.
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?
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 ?
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?
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
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
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.
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.
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.
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.
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.
andreychek, I took your advice and removed everything from Rpmforge, EPEL, webmin, virtualmin, then removed all the repos, then ran the install script.
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!
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
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
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?