New domains no php

7 posts / 0 new
Last post
#1 Thu, 10/28/2010 - 21:02
wolfsden3

New domains no php

I don't know what broke! I create a new domain and upload / create an infophp.php file with this content:

<?php
phpinfo();
?>

It WORKS on the two sites I had created months ago but I just created a new site the other day and have troubleshooted this to no end. It'll show HTML stuff but not PHP, well...now HTML stuff is broke too :P

The old sites have these directories:

awstats cgi-bin etc fcgi-bin homes logs Maildir public_html tmp

The new sites have ONLY these directories:

awstats cgi-bin homes logs public_html

Soooooooo, CLEARLY something's "broken", it doesn't create the same directories, I'm missing tmp, Maildir, and fcgi-bin

I haven't updated the OS or webmin until I was having problems, I updated webmin.

Here's what I've got:

Cent OS 5.5 Kernel: 2.6.18-194.el5 Virtualmin version 3.81.gpl GPL Webmin version 1.520 Real memory 1010.85 MB total, 334.94 MB used Local disk space 27.10 GB total, 5.14 GB used Package updates All Virtualmin packages are up to date.

I'm not sure what logs to post, I'm not too into VirtualMin so I don't know how to look at the scripts that create accounts. I suspect something's broken in the account creations scripts since some folders aren't getting created. Lastly, I did try to cp some stuff over from an account that works to see if all it needed was the files but no love, I might not have done something right...not sure.

Anyone have any insight into this weird behavior? I've rebooted the server a lot of times :P

Thanks!

Fri, 10/29/2010 - 10:09
andreychek

Hmm... what do you see when running PHP code on the domain that's not working?

Also, if you take a peek in ~/logs/error_log, do you see anything interesting after trying to access your site?

Lastly, you may want to take a peek at the VirtualHost data that was generated for your account in /etc/httpd/conf/httpd.conf, and verify that it looks correct (ie, are the paths and such what you'd expect?).

-Eric

Fri, 10/29/2010 - 10:18
Locutus

About the missing directories: Which VMin features are activated for the virtual server in question? What execution mode is PHP set to?

Fri, 10/29/2010 - 15:33
wolfsden3

Hi Eric & Locutus...thanks for trying to help me out!

Q: Hmm... what do you see when running PHP code on the domain that's not working?

A: I see a blank page but then I view source from my browser and see:

< ? php

phpinfo();

? >

  • I'm accessing site like this: http://ipaddreshere/~accountnamehere <-- Used to work well if DNS wasn't ready yet
  • I'd also like to note that the php info code is broken up here so it'll display properly, doesn't look like they like php code in the post :P

Q: Also, if you take a peek in ~/logs/error_log, do you see anything interesting after trying to access your site?

A: They log files are blank, 0 lines

  • Both the access_log and error_log are blank on both my test accounts

Statement: Lastly, you may want to take a peek at the VirtualHost data that was generated for your account in /etc/httpd/conf/httpd.conf, and verify that it looks correct (ie, are the paths and such what you'd expect?).

httpd.conf: * Not that xx.xx.xx.xx:80 is a real external IP :P

SuexecUserGroup #508 #507 ServerName blah ServerAlias www.blah ServerAlias webmail.blah ServerAlias admin.blah DocumentRoot /home/blah/public_html ErrorLog /var/log/virtualmin/blah_error_log CustomLog /var/log/virtualmin/blah_access_log combined ScriptAlias /cgi-bin/ /home/blah/cgi-bin/ ScriptAlias /awstats/ /home/blah/cgi-bin/ DirectoryIndex index.html index.htm index.php index.php4 index.php5 Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI allow from all AllowOverride All AddHandler fcgid-script .php AddHandler fcgid-script .php5 FCGIWrapper /home/blah/fcgi-bin/php5.fcgi .php FCGIWrapper /home/blah/fcgi-bin/php5.fcgi .php5 allow from all RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.blah RewriteRule ^(.) https://blah:20000/ [R] RewriteCond %{HTTP_HOST} =admin.blah RewriteRule ^(.) https://blah:10000/ [R] RemoveHandler .php RemoveHandler .php5 IPCCommTimeout 31 AuthName "blah2 statistics" AuthType Basic AuthUserFile /home/blah/.awstats-htpasswd require valid-user RedirectMatch /cgi-bin/mailman/([^/.])(.cgi)?(.) https://blah:10000/virtualmin-mailman/unauthenticated/$1.cgi$3 RedirectMatch /mailman/([^/.])(.cgi)?(.) https://blah:10000/virtualmin-mailman/unauthenticated/$1.cgi$3 Alias /pipermail /var/lib/mailman/archives/public

Hi Locutus (I like 7 of 9 WAY better than Locutus by the way, she's hawt :P)...

Q: Which VMin features are activated for the virtual server in question? What execution mode is PHP set to?

A:

Enabled features when creating a new account:

Setup DNS zone - Yes Accept mail for domain - Yes Setup website for domain - Yes Setup Webalizer for web logs - Yes Create MySQL login - Yes Setup IP-based virtual FTP - No Setup spam filtering - Yes Setup virus filtering - Yes Create Webmin login - Yes Enable AWstats reporting - Yes Allow Mailman mailing lists - Yes

Execution mode of PHP:

FCGId (run as virtual server owner)

Fri, 10/29/2010 - 15:44
andreychek

I'm accessing site like this: http://ipaddreshere/~accountnamehere

Aha! Yeah, that's the problem :-)

Using the ~/username method of accessing a site ends up bypassing the CGI/FCGID+suexec setup, which breaks processing PHP applications.

You may have luck using mod_php, though I'm not certain.

However, a better recommendation would be to instead use an alias for your Virtual Server without DNS.

So if your servers hostname is "hostname.server.tld", and you need a way of accessing the domain "new_domain.com", whose DNS isn't configured yet... you can setup an alias such as "new_domain.server.tld".

To do that, just go into Create Virtual Server, and create a new alias server.

Also, starting in the next version of Virtualmin, you can have it automatically create new aliases for every Virtual Server that's created.

-Eric

Fri, 10/29/2010 - 18:06
Locutus

@wolfsden3: Hmmm... Okay, if "Accept mail for domain" is active, it should create the Maildir for your vserver admin user I suppose.

When you go to Edit Mail and FTP Users -> {VServer admin user}, what does the entry *Email settings : Inbox mail file read?

Btw, I quite agree about Seven-of-Nine. :)

Mon, 11/01/2010 - 10:07
wolfsden3

Eric, that was exactly the problem! Thank you to all for your help and suggestions. What we did then on our XP Windows machines to "test" the site was to make an entry in our hosts file on XP to point the IP address of our server to the hostname of the test account blah.com or whatever we're testing...it worked. PHP info showed us what we expected to see.

With CPanel you can do it like that, http://ip/~username so I assumed you could with VirtualMin too ;-)

Bad to assume I guess.

Thanks again!

Topic locked