Setting Up Virtual Server

16 posts / 0 new
Last post
#1 Wed, 11/05/2008 - 13:34
jiontrois

Setting Up Virtual Server

hello to all, i'm new in virtmin, ive installed webmin+virtmin on a debian 4.0rc4 and after general configuration i'v tried to make my first virt server, and the output was that. Pls can any one help me?

Setting Up Virtual Server In domain jiontro.info Creating administration group jiontro .. .. done Creating administration user jiontro .. .. done Creating aliases for administration user .. .. done Adding administration user to groups .. .. done Creating home directory .. .. done Creating mailbox for administration user .. .. done Adding to email domains list .. .. done Adding default mail aliases .. .. done Adding new DNS zone .. .. done Adding new virtual website .. .. Apache website failed! : Failed to open /var/www/jiontro/jiontro.info/logs/access_log for writing : Bad file descriptor at ../web-lib-funcs.pl line 1010. Setting up scheduled Webalizer reporting .. .. Webalizer reporting failed! : Failed to open /var/www/jiontro/jiontro.info/public_html//stats/.htaccess for writing : Bad file descriptor at ../web-lib-funcs.pl line 1010. Creating SSL certificate and private key .. .. done Adding new SSL virtual website .. .. done Setting up log file rotation .. .. done Creating MySQL login .. .. done Creating MySQL database jiontro .. .. done Creating PostgreSQL login .. .. done Creating PostgreSQL database jiontro .. .. done Creating FTP virtual server .. .. done Adding ProFTPd user ftp to server's group .. .. done Setting up spam filtering .. .. done Setting up virus filtering .. .. done Creating Webmin user .. .. done Adding virtual IP interface for 192.0.0.1 .. .. created interface eth0:1 Re-starting DNS server .. .. done Stopping and re-starting web server .. .. done Applying FTP server configuration .. .. done Re-loading Webmin .. .. done Saving server details .. .. done Sending email notification to domain owner .. .. email sent to jiontro@jiontro.info
Thu, 11/06/2008 - 05:38
andreychek

Well, first, /var/www is an unusual place to put websites in the Virtualmin world, you may end up running into problems by pointing your path there (those are usually kept in /home).

That said, I'm not sure why it broke there, what do you get when you run these commands:

ls -la /var/www/jiontro/jiontro.info/logs/

ls -la /var/www/jiontro/jiontro.info/public_html//stats/

Thanks,
-Eric

Thu, 11/06/2008 - 08:04 (Reply to #2)
jiontrois

<b>now i don't know, but i figured out that the problem is in log file format wich i think isn't correctly setted in virt min server template in apache directives, cose after that i try to restart apache (cose is died) i get an error message like:<div class='quote'> Starting web server (apache2)...Syntax error on line 6 of /etc/apache2/sites-enabled/jiontro.info.conf:
ErrorLog takes one argument, The filename of the error log
failed!</div> for creating new virts i get: <div class='quote'>Adding new virtual website ..
.. Apache website failed! : Failed to open /logs/html/access.log for writing : Bad file descriptor at ../web-lib-funcs.pl line 1010.</div> and the file has: <div class='quote'> &lt;VirtualHost 82.77.208.172:80&gt;
SuexecUserGroup &quot;#1000&quot; &quot;#1003&quot;
ServerName jiontro.info
ServerAlias www.jiontro.info
DocumentRoot /var/www/jiontro/www/
ErrorLog &quot;|/etc/webmin/virtual-server/writelogs.pl 122599422410420 /logs/html/error.log&quot; log/
CustomLog &quot;|/etc/webmin/virtual-server/writelogs.pl 122599422410420 /logs/html/access.log&quot; comb/
ScriptAlias /cgi-bin/ /var/www/jiontro/www/cgi-bin/
ScriptAlias /awstats /var/www/jiontro//cgi-bin/awstats
DirectoryIndex index.html index.htm index.php index.php4 index.php5 index.cgi
Options ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch
&lt;Directory /var/www/jiontro/www/&gt;
Options -Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
&lt;/Directory&gt;
&lt;Directory /var/www/jiontro/www/cgi-bin/&gt;
allow from all
&lt;/Directory&gt;
&lt;Files awstats.pl&gt;
AuthName &quot;jiontro.info statistics&quot;
AuthType Basic
AuthUserFile /var/www/jiontro/.awstats-htpasswd
require valid-user
&lt;/Files&gt;
&lt;/VirtualHost&gt;
&lt;VirtualHost 82.77.208.172:443&gt;
SuexecUserGroup &quot;#1000&quot; &quot;#1003&quot;
ServerName jiontro.info
ServerAlias www.jiontro.info
DocumentRoot /var/www/jiontro/www/
ErrorLog &quot;|/etc/webmin/virtual-server/writelogs.pl 122599422410420 /logs/html/error.log&quot; log/
CustomLog &quot;|/etc/webmin/virtual-server/writelogs.pl 122599422410420 /logs/html/access.log&quot; comb/
ScriptAlias /cgi-bin/ /var/www/jiontro/www/cgi-bin/
ScriptAlias /awstats /var/www/jiontro//cgi-bin/awstats
DirectoryIndex index.html index.htm index.php index.php4 index.php5 index.cgi
Options ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch
&lt;Directory /var/www/jiontro/www/&gt;
Options -Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
&lt;/Directory&gt;
&lt;Directory /var/www/jiontro/www/cgi-bin/&gt;
allow from all
&lt;/Directory&gt;
SSLEngine on
SSLCertificateFile /var/www/jiontro/ssl.cert
SSLCertificateKeyFile /var/www/jiontro/ssl.key
&lt;Files awstats.pl&gt;
AuthName &quot;jiontro.info statistics&quot;
AuthType Basic
AuthUserFile /var/www/jiontro/.awstats-htpasswd
require valid-user
&lt;/Files&gt;
&lt;/VirtualHost&gt;
/logs/html/error.log&quot; log/</div></b>

Thu, 11/06/2008 - 08:23 (Reply to #3)
jiontrois

and after aplying <div class='quote'>ls -la /var/www/jiontro/logs</div> for the new virt created i get <div class='quote'>root@maveion:/home/administrator# ls -la /var/www/jiontro/logs
total 8
drwxr-x--- 2 jiontro jiontro 4096 2008-11-06 19:57 .
drwxr-xr-x 7 jiontro jiontro 4096 2008-11-06 19:57 ..
</div>

Sun, 06/07/2009 - 07:31 (Reply to #4)
ronald
ronald's picture

can you check your /home directory as your site is visible under IP but not under domain name.
Bad file descriptor has often to do with rights
Do you have stuff like this in the server template? thus pointing to /home and not /var/www as /home is default in virtualmin

[code:1]ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog ${HOME}/logs/error_log
CustomLog ${HOME}/logs/access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php
&lt;Directory ${HOME}/public_html&gt;
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
&lt;/Directory&gt;[/code:1]

Sun, 06/07/2009 - 07:31 (Reply to #5)
ronald
ronald's picture

can you check your /home directory as your site is visible under IP but not under domain name.
Bad file descriptor has often to do with rights
Do you have stuff like this in the server template? thus pointing to /home and not /var/www as /home is default in virtualmin

[code:1]ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog ${HOME}/logs/error_log
CustomLog ${HOME}/logs/access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php
&lt;Directory ${HOME}/public_html&gt;
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
&lt;/Directory&gt;[/code:1]

Sun, 06/07/2009 - 07:31
Joe
Joe's picture

The ${HOME} variable technically gets pulled in from the Users and Groups module (which determines where almost everything goes in a Virtualmin domain or mailbox) <i>or</i> from the &quot;Home directory base&quot; setting in &quot;Module Configuration:Defaults for new domains&quot;. So, if it's set correctly, then everything else should fall into place automatically.

There <i>are</i> a few quirks in other software that might give troubles with homes being in /var/www, but Virtualmin ought to fall right into line when configured correctly.

--

Check out the forum guidelines!

Fri, 01/02/2009 - 11:05
anwoke8204

Hi, I am getting the following error when I try to set up my first virtual server, any help would be apprecieated. I am using Ubuntu server 8.04 edition.

Creating administration group realdealcars ..
.. done
Creating administration user realdealcars ..
.. done

Creating aliases for administration user ..
.. aliases failed : Died at ../web-lib-funcs.pl line 1010.

Adding administration user to groups ..
.. failed : Died at ../web-lib-funcs.pl line 1010.

Creating home directory ..
.. done

Creating mailbox for administration user ..
.. done

Adding to email domains list ..
.. Mail for domain failed! : Died at ../web-lib-funcs.pl line 1010.

Adding new DNS zone ..
.. done

Adding new virtual website ..
.. done

Adding Apache user www-data to server's group ..
.. done

Setting up scheduled Webalizer reporting ..
.. done

Setting up log file rotation ..
.. done

Creating MySQL login ..
.. done

Creating MySQL database realdealcars ..
.. done

Setting up spam filtering ..
.. done

Setting up virus filtering ..
.. done

Adding DAV directives to website configuration ..
.. done

.. DAV Login failed! : virtualmin-dav::feature_setup failed : Died at ../web-lib-funcs.pl line 1010.

Setting up AWstats reporting ..
.. done

Setting up password protection for AWstats ..
.. done

Adding Mailman alias and redirects to website configuration ..
.. done

Creating Webmin user ..
.. done

Re-starting DNS server ..
.. done

Applying web server configuration ..
.. done

Re-loading Webmin ..
.. done

Saving server details ..
.. done

TIA
Andrew

Fri, 01/02/2009 - 11:10
anwoke8204

I also get the following when I run the check config..
The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin base directory is /home. CGI and PHP scripts run as domain owners will not be executed.

.. your system is not ready for use by Virtualmin.

any idea as to how I fix this?

TIA

Fri, 01/02/2009 - 15:10 (Reply to #9)
andreychek

Hey Andrew,

Hmm, those are certainly some odd errors you're seeing when adding a Virtual Server. But the second post you made makes me suspect it may not have been setup properly during installation -- did you by chance use the install.sh script to perform the install?

If not, and you don't have anything &quot;live&quot; at the moment, I might recommend downloading the installer, and running it. It does all sorts of setup work for you that you'd otherwise need to do manually.

If you're using the GPL version, you can download it from here:

http://webmin.com/vinstall.html

The Pro version is available here:

http://virtualmin.com/serial/

If you still have trouble, I'd be curious about:

* What distro you're using

* What Virtualmin version you have installed

* How you installed Virtualmin

Thanks!
-Eric

Fri, 01/02/2009 - 16:14
anwoke8204

I did use the installer, I don't have anything live yet per say, as I am in the process of switching from a windows based webserver to linux. I have been haveing other issues with postfix and integrating amavisd, could that be causing the issue?
Many thanks for the help

Fri, 01/02/2009 - 21:57 (Reply to #11)
andreychek

Hmm, could Amavis be related to your problem above? Maybe...

How about this, what does your /etc/postfix/main.cf file look like?

Most of the items that failed above were email related, I wonder if something about the configuration there could be throwing it off.
-Eric

Fri, 01/02/2009 - 22:23
anwoke8204

should I post my postfix/main.cf file here so you can take a look at it?

Sun, 06/07/2009 - 07:34
anwoke8204

here is my postfix/main.cf file:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate &quot;delayed mail&quot; warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

#myhostname = /etc/mailname
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
# this specifies where the virtual mailbox folders will be located
virtual_mailbox_base = /var/spool/mail/virtual
# this is for the mailbox location for each user
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
# and their user id
virtual_uid_maps = mysql:/etc/postfix/mysql_uid.cf
# and group id
virtual_gid_maps = mysql:/etc/postfix/mysql_gid.cf
# and this is for aliases
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
# and this is for domain lookups
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
# this is how to connect to the domains (all virtual, but the option is there)
# not used yet
# transport_maps = mysql:/etc/postfix/mysql_transport.cf
#myorigin = rooksystems.com
Local_recipient_maps =
mydestination = rooksystems.com, realdealcars.org
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a &quot;$EXTENSION&quot;
mailbox_size_limit = 0
recipient_delimiter =
inet_interfaces = all
mynetworks_style = host

# how long if undelivered before sending warning update to sender
delay_warning_time = 4h
# will it be a permanent error or temporary
unknown_local_recipient_reject_code = 450
# how long to keep message on queue before return as failed.
# some have 3 days, I have 16 days as I am backup server for some people
# whom go on holiday with their server switched off.
maximal_queue_lifetime = 7d
# max and min time in seconds between retries if connection failed
minimal_backoff_time = 1000s
maximal_backoff_time = 8000s
# how long to wait when servers connect before receiving rest of data
smtp_helo_timeout = 60s
# how many address can be used in one message.
# effective stopper to mass spammers, accidental copy in whole address list
# but may restrict intentional mail shots.
smtpd_recipient_limit = 16
# how many error before back off.
smtpd_soft_error_limit = 3
# how many max errors before blocking it.
smtpd_hard_error_limit = 12

# Requirements for the HELO statement
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname,
reject_invalid_hostname, permit
# Requirements for the sender details
smtpd_sender_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_sender,
reject_unknown_sender_domain, reject_unauth_pipelining, permit
# Requirements for the connecting server
smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org,
reject_rbl_client blackholes.easynet.nl,
reject_rbl_client dnsbl.njabl.org
# Requirement for the recipient address
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination

# require proper helo at connections
smtpd_helo_required = yes
# waste spammers time before rejecting them
smtpd_delay_reject = yes
disable_vrfy_command = yes
content_filter = amavis:[127.0.0.1]:10024
sender_bcc_maps = hash:/etc/postfix/bcc
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
inet_protocols = all

I used the following site to try to get multiple domains up and running with email before I found virtualmin, I have been using webmin and usermin for a few weeks now, but didn't find virtualmin till today. I used: http://flurdy.com/docs/postfix/ to create a link between mysql and postfix using courier-imap, courier-authdaemonrc, and courier-imap-ssl for the imap server, but have been having issues, that could be throwing it off as well. would it help if I removed postfix, amavis, clamav, webmin, usermin, apache, virtualmin, and everything and then ran the install script again. if that would help how would I remove them to remove all configureing done. many thanks

Sat, 01/03/2009 - 01:58
anwoke8204

I got all of the mail issues worked out by completly uninstallnig everything and then running the script to install apache, postfix, webmin, usermin, virtualmin, and all of the nessicary packages, but now I have a bunch of messages in the postfix mail queue that I can't flush and when trying to enable the DNS registration package in virtualmin I get the following error still:

The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin base directory is /home. CGI and PHP scripts run as domain owners will not be executed.

any idea as to how I fix these 2 errors?
TIA

Sat, 01/03/2009 - 09:19 (Reply to #15)
andreychek

Howdy,

Well, I'm glad you have it largely working. In your main.cf, it looks like it had been trying to use MySQL to store addresses/aliases and such, I suspect that may have been related.

The &quot;suexec&quot; error you're seeing is odd -- that's usually resolved by running the install.sh script.

You say you're running this on Ubuntu 8.04?

Essentially, the issue is that your server has the distro's version of the Apache packages, rather than Virtualmin's.

There are two ways to resolve that:

1. Disable suexec. That's an easy way around it, but I'd only recommend that if all the users and scripts on your system are trusted.

2. Perhaps the best way to fix this would be to install the Apache related packages from the Virtualmin repository in place of the ones on your system now.

There's some more discussion on that issue around, such as this thread here:

http://www.virtualmin.com/forums/virtualmin/re:suexec-error-when-checkin...

Let us know if that works!
-Eric