reinstalled: have fresh virtualmin/webmin apache not starting and question about default domain

After Locutus was kind enough to go through my system and showed me how it might have already been compromised, I decided I should just pull off all the content, re-install and start again. Though I had nginx up on the initial install, since I’m using mostly wordpress sites I followed his recommendation to install apache, but I’m having problems with virtualmin / virtual servers and can’t get apache to run after an intitial install was working. I’m sure it’s something I did wrong but:

I had set up the default fqdn as grimmwerks.com because that’s really my main domain; I thought it would be easier. Since I needed email for this domain, I thought I should create a virtual server as grimmwerks.com - in a way duplicating the original default domain; I’m not sure if this is what I should’ve done.

So now I’ve got the default /var/www and /home/grimmwerks/public_html to choose to put the files; I put them at /var/www for now.

I created anotther domain - my wife’s lollyrot and began putting the files at /home/lollyrot/public_html. Things were ok at the start, but once I tried rebooting the server, apache wouldn’t run and gave me this message:

Failed to start service : * Starting web server apache2 Syntax error on line 1 of /etc/apache2/sites-enabled/grimmwerks.com.conf: The address or port is invalid Action 'start' failed. The Apache error log may have more information. ...fail!

I’ve event tried commenting out this conf since it’s really using a virtual server that the default server is, but then I get the SAME error alert for the lollyrot.com domain.

So my question is twofold:

#1) how can I fix this so that it runs and I can have many virtual servers in apache without issue

#2) what is the ‘normal’ setup if you have the fqdn / default domain to be one that you want email on as well?

I could always set the fqdn to a domain I have but don’t care about just as the admin domain but I’d like to know the proper thing to do?

Syntax error on line 1 of /etc/apache2/sites-enabled/grimmwerks.com.conf: The address or port is invalid Action 'configtest' failed. The Apache error log may have more information.

So my grimmwerks.com.conf:

<VirtualHost 107.150.7.19:80 [107.150.7.19]:80>
SuexecUserGroup “#1000” “#1000
ServerName grimmwerks.com
ServerAlias www.grimmwerks.com
ServerAlias webmail.grimmwerks.com
ServerAlias admin.grimmwerks.com
DocumentRoot /home/grimmwerks/public_html
ErrorLog /var/log/virtualmin/grimmwerks.com_error_log
CustomLog /var/log/virtualmin/grimmwerks.com_access_log combined
ScriptAlias /cgi-bin/ /home/grimmwerks/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/grimmwerks/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/grimmwerks/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/grimmwerks/fcgi-bin/php5.fcgi .php5

<Directory /home/grimmwerks/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.grimmwerks.com
RewriteRule ^(.) https://grimmwerks.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.grimmwerks.com
RewriteRule ^(.
) https://grimmwerks.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824

<VirtualHost 107.150.7.19:443 [107.150.7.19]:443>
SuexecUserGroup “#1000” “#1000
ServerName grimmwerks.com
ServerAlias www.grimmwerks.com
ServerAlias webmail.grimmwerks.com
ServerAlias admin.grimmwerks.com
DocumentRoot /home/grimmwerks/public_html
ErrorLog /var/log/virtualmin/grimmwerks.com_error_log
CustomLog /var/log/virtualmin/grimmwerks.com_access_log combined
ScriptAlias /cgi-bin/ /home/grimmwerks/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/grimmwerks/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/grimmwerks/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/grimmwerks/fcgi-bin/php5.fcgi .php5

<Directory /home/grimmwerks/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.grimmwerks.com
RewriteRule ^(.) https://grimmwerks.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.grimmwerks.com
RewriteRule ^(.
) https://grimmwerks.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
SSLEngine on
SSLCertificateFile /home/grimmwerks/ssl.cert
SSLCertificateKeyFile /home/grimmwerks/ssl.key

Not sure what it might be - the external ip showing up here?
Could I (should I) change the document root here to /var/www as well?

Howdy,

I would recommend using the default DocumentRoot, which points to /home/username/public_html.

Also, I think the error you’re receiving is in regards to this line:

<VirtualHost 107.150.7.x:80 [107.150.7.x]:80>

I think that should just look like this:

`<VirtualHost 107.150.7.x:80>

If you update your domains to use this corrected version, does Apache stop throwing an error about that?

-Eric

OK now I’m losing my mind here.

I figured out the apache problem – for some reason virtual servers were being created with [] around an ip:

<VirtualHost 107.150.7.19:80 [107.150.7.19]:80>

I fixed this. But now I’m confused about something else.

I’ve got a number of domains up:

www.grimmwerks.com
www.lollyrot.com
www.tandeva.com
www.advocatesdiary.com

They’re all created separately, normal nothing fancy. www.grimmwerks.com is my site, www.advocatesdiary.com is my mother in law, and www.lollyrot.com is supposed to be my wife.

grimmwerks, advocatesdiary and tandeva (as a test) all work properly. But lollyrot.com ALWAYS goes to www.advocatesdiary.com and I see no reason for that at all.

I thought – when I first got up all the wordpress files - perhaps there was some sort of flaky wordpress db re-routing, but that’s not the case – right now I just have an index.php with a

LOLLYROT

to show which site it is – it’s not going there.

I’m looking through the logs and I see no other issue.

NEVERMIND.

It seems there was still some flaky [ip] issues, I cleared them of one of the confs, restarted apache and all seems right with the world.