Apache and Misc problems

35 posts / 0 new
Last post
#1 Sun, 02/05/2012 - 15:15
techforce

Apache and Misc problems

HI:

Trying out the newest version of Webmin on an Ubuntu 64 OS, and Apache is driving me nuts. I removed the 1st virtual domain which I guess is the default var/www folder, and apache wont start up, says it looks for the file that is suppose to tell it the list of sites , and its either no longer there, or its not readable. This is the second time I had this problem, and the first time, I tried to reinstall apache at the comand prompt, and it created more problems. Removing the module from webmin modules will keep the virtual zones in there when you re-install, so its not really like a fresh start f you make a mistake. I wound up reinstalling webmin, after doing a purge of everything...and then I recreated this same problem when I deleted the virtual host setting for the var/www folder. It seems you cant get around not having that zone active, but it will let you delete it without a warning....and I guess the module delete function dont ask you if you want to start over or not. I thought I could remove that one because if I type: http://ipaddressofserver , whatever is in that folder will show up, and at times the site I was working on setting up was the only one coming up when I called paths to different folders from that url.

I also have problems with postfix and sendmail and fetchmail.....seems I cant get any of them to connect together to actually fetch the mail for my single email user.

I used Virtualmin/ Webmin almost 2 years ago, and was hit with some kind of script attack that caused pages to become blank...so I ditched it. Later I was told that it may have been because the host provider did not do all their updates. I never really found out how it got there, but thought I would try it now and test the waters again. I dont remember it being this complex though the last time, but back then I had someone helping me that did most the setup. Is there a sequence to follow when you set up the mail systems and domains in apache? I noticed some modules depend on apache, and at times more then one mail program got installed, how, I dont know.....

Mon, 02/06/2012 - 08:35
andreychek

I thought I could remove that one because if I type: http://ipaddressofserver , whatever is in that folder will show up, and at times the site I was working on setting up was the only one coming up when I called paths to different folders from that url.

Well, you should be able to remove that first domain in Ubuntu, so there may be something about the way you're removing it that's causing trouble. If you want to talk about that, we can certainly go over how you're removing that, and see if there's any reason why that's not working properly.

However, another way to solve this particular problem would be to choose a domain you want to act as your default domain -- and then we can tell Virtualmin to always load it, and not that first domain in Apache -- to load whenever accessing the server by IP address.

To do that, just go into Server Configuration -> Website Options, and set "Default website for IP address".

-Eric

Mon, 02/06/2012 - 09:05
techforce

I wound up purging, then re-installing apache2 for the 2nd time via the command prompt in ssh. It rebuilt the file 000-default under sites enabled folder in apache2. Doing a regular Webmin module remove for apache, then reinstalling , wont rebuild that file, or it causes a syntax error inside it I think....at least thats what it says when you try to restart apache from Webmin. When you reinstall that apache module, it actualy does not remove anything under the sites enabled folder. I think it may be a good idea for a newer version of the module to ask weather or not to keep them, or remove the sites currently enabled.

I had another problem because my ftp session didnt upload all the files needed for one of the var/www domains...and that took a while before I could figure it out, but with the new 000-default file in there, that is basicly the var/www main index folder, and I cant see a way to get the other domains I have in that folder to load without having that initial virtual 000-default in there. It may be because right now, I am not using a dns to resolve all my domains...I am merely testing via http://serveripaddress/whateverdomain , to make sure all the files are good, and that the mysql system is able to connect - etc. Last night I had the sql working, but seems now that I have removed apache2, it took out the installation of phpmyadmin along with it, so will need to re-install that too.

Definately I will need help with the postfix / sendmail / fetchmail stuff........

Wed, 02/08/2012 - 16:46
techforce

Ok, looks like I got the apache2 stuff under control. What I dont understand now is the mail. I have setup mail before with other panels like cpanel / plesk, but something seems to have glitched. I have previous past experience not so great with Qmail, so I elected postfix. Seems we also need fetchmail, so I included that module. Do we need sendmail too? I would think no because if I check the ports I get:

lsof -i :110 lsof -i :25 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME master 29583 root 12u IPv4 172075 0t0 TCP *:smtp (LISTEN)

So 25 smtp is listening, however seems my pop / 110 port is dead. At one point I had the system accepting the mail but fetchmail would not deliver. Do I need to set up the mail.domain.com over in the bind dns server under each domain I put there? I do have one domain actually set up with a resolving DNS to the site itself, and apache will load it fine, and its mail.domain.com addy resolves to the IP of the server, but when it goes to connect, is says there is no socket, which I guess it because there is nothing listening on port 110. Can anyone help? I did notice at one point sendmail would no longer start, and supplied no error messages, so I removed it as a module....at one point I tried Exim, but its no longer showing up anywhere as a remove or an install possibility. I lije the fact you can switch between all these mail clients. Back in plesk you are stuck with Qmail, and its terrible.

Wed, 02/08/2012 - 17:58
andreychek

How did you install Virtualmin onto your system? Did you use the install.sh installer?

The issues you're running into are uncommon -- normally when using the install.sh to perform an installation, you'd end up with Apache and Postfix working out of the box, as well as Dovecot which runs on ports 110 and 143.

If you didn't use the install.sh to perform your installation, that means you have a lot of manual work ahead of you :-)

Also, which version of Ubuntu is it that you're using there? Virtualmin only supports the Ubuntu LTS releases, the latest of which is 10.04.

So if you hadn't used the install.sh script, my recommendation would be to start with a fresh installation of Ubuntu 10.04, and use the install.sh script to get Virtualmin up and running.

You should, in theory, end up with a fully working system out of the box :-)

Once you do get things up and running -- although you can use other mail servers, it's not recommended that you use anything but Postfix... it's well supported, and it's easy to get help if anything does happen to go wrong.

Regarding port 110 -- you may want to try launching dovecot though, as that's the service that normally runs on that port. You can launch it with this command:

/etc/init.d/dovecot start

Wed, 02/08/2012 - 18:38
techforce

Thank you for that information. Ubuntu 10.4.x

This is the 2nd install of Virtualmin - the first time was the hosting company that installed it, not sure how they did it.When it broke down, I googled for reinstalling , followed the instructions from the command prompt, and scrolled back to my commands to reinstall apache2 from when I encountered problems on the first Vm instaled system. I do not ever remember dovecot being installed at any point by default. Is it a dependent module for postfix?

Here are some of the commands I entered when installing webmin for the2nd time:

wget http://ftp.debian.org/pool/main/libm/libmd5-perl/libmd5-perl_2

.03-1_all.deb

(which I believe failed)

wget http://mirrors.kernel.org/ubuntu/pool/universe/libm/libmd5-per

l/libmd5-perl_2.03-1_all.deb

(I think I needed that to do the install)

The rest of these seemed to work :

sudo dpkg -i libmd5-perl_2.03-1_all.deb

sudo dpkg -i webmin_1.510_all.deb

sudo dpkg -i libmd5-perl_2.03-1_all.deb

(not sure why I had to do this, but I do remember it wasput it in a cdworks folder, probably my mistake)

wget http://downloads.sourceforge.net/project/webadmin/webmin/1.510

/webmin_1.510-2_all.deb?use_mirror=cdnetworks-us-1

Then I ran:

sudo dpkg -i webmin_1.510-2_all.deb?use_mirror=cdnetworks-us-1

...which executed from that folder, seemed to install without any problems.

I do recall apache in there as the default, however there was a setup page for the mail where I had to select which system from a drop down box I wanted to use. Options were postfix, exim and I think qmail and some others. At one point it was letting me set exim when it was not installed, but I do remember installing it. Perhaps there ought to be some troubleshooting the team could do regarding that interface someday, because it does not seem you can dynamicly swap from different mail systems if in your configuring, the one you are working with does not work for some reason - seems there was a problem that propogated itself into making no mail client work, save for maybe qmail, which I dont want to try because I have had problems with it before.

Wed, 02/08/2012 - 20:54
techforce

Also just tried installing Dovecot , failed !

#

Installing package(s) with command apt-get -y --force-yes -f install dovecot-common dovecot-imapd dovecot-pop3d ..

Reading package lists... Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: m4 procmail sendmail-cf sendmail-base libdb4.7 Use 'apt-get autoremove' to remove them. Suggested packages: ntp The following NEW packages will be installed: dovecot-common dovecot-imapd dovecot-pop3d 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 7805kB of archives. After this operation, 15.7MB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main dovecot-common 1:1.2.9-1ubuntu6.5 [5510kB] Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main dovecot-imapd 1:1.2.9-1ubuntu6.5 [1202kB] Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main dovecot-pop3d 1:1.2.9-1ubuntu6.5 [1093kB] Fetched 7805kB in 3s (2582kB/s) Selecting previously deselected package dovecot-common. (Reading database ... 71051 files and directories currently installed.) Unpacking dovecot-common (from .../dovecot-common_1%3a1.2.9-1ubuntu6.5_amd64.deb) ... Selecting previously deselected package dovecot-imapd. Unpacking dovecot-imapd (from .../dovecot-imapd_1%3a1.2.9-1ubuntu6.5_amd64.deb) ... Selecting previously deselected package dovecot-pop3d. Unpacking dovecot-pop3d (from .../dovecot-pop3d_1%3a1.2.9-1ubuntu6.5_amd64.deb) ... Processing triggers for ufw ... Processing triggers for ureadahead ... Processing triggers for man-db ... Setting up dovecot-common (1:1.2.9-1ubuntu6.5) ...

Creating config file /etc/dovecot/dovecot.conf with new version

Creating config file /etc/dovecot/dovecot-ldap.conf with new version

Creating config file /etc/dovecot/dovecot-sql.conf with new version adduser: Warning: The home directory `/usr/lib/dovecot' does not belong to the user you are currently creating. Creating generic self-signed certificate: /etc/ssl/certs/dovecot.pem (replace with hand-crafted or authorized one if needed). hostname: Name or service not known dpkg: error processing dovecot-common (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of dovecot-imapd: dovecot-imapd depends on dovecot-common (= 1:1.2.9-1ubuntu6.5); however: Package dovecot-common is not configured yet. dpkg: error processing dovecot-imapd (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of dovecot-pop3d: dovecot-pop3d depends on dovecot-common (= 1:1.2.9-1ubuntu6.5); however: Package dovecot-common is not configured yet. dpkg: error processing dovecot-pop3d (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: dovecot-common dovecot-imapd dovecot-pop3d E: Sub-process /usr/bin/dpkg returned an error code (1) .. install failed!

#

But I can see it in the servers area, however it wont start: (Error: ssl_cert_file: Can't use /etc/ssl/certs/dovecot.pem: No such file or directory Fatal: Invalid configuration in /etc/dovecot/dovecot.conf)

Wed, 02/08/2012 - 22:09
andreychek

I do not ever remember dovecot being installed at any point by default. Is it a dependent module for postfix?

Nope! It's not a dependency of Postfix, they're considered separate by Ubuntu, since there are a variety of POP/IMAP services you could use. However, Virtualmin makes use of Dovecot.

When installing Virtualmin via the install.sh -- that would pull in all the services such as Postfix, Dovecot, MySQL, Apache, SpamAssassin, ClamAV, and such, and it will also configure them to work properly.

When not using the install.sh, that's a manual installation -- it's a lot more work, but it can still be done. Directions for a manual installation are here:

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

I'd highly recommend using a fresh distribution install, and using the install.sh script. However, if you'd like to try to continue with what you have, the above should help.

Also just tried installing Dovecot , failed !

Well, I see this error in there:

hostname: Name or service not known

Dovecot requires that "hostname -f" return an FQDN in order for it to install properly. You may want to review what your hostname is, and make sure that hostname -f is returning an FQDN.

-Eric

Thu, 02/09/2012 - 09:40
techforce

Ok, I fixed the hostname -f problem, somehow it had kept part of the old hostname alongside of the new one....and never prompted me to change the option -f part.

Rebooted, and now its listening on the port fine. However any mail sent to the test address gives a relaying error. Also when checking mail, its saying text logins are disallowed. Searched google for that, and saw where in the dovecot conf, that is the default setting. I found 2 config files with that setting = yes, and I changed to = no, but its still giving that message during the login. Rebooted again just to check, and same thing....? Also of note, during the server test for the fetchmail, its saying the mailserver does not equal the address [ fetchmail: Server CommonName mismatch]. I had it as same as server name, and then the actual IP addy of the server and same thing. The domain itself resolves to the server in dns checks....but the name I am using for the hostname is my old servername which has a domain that is still hosted on my old server I am moving from....is that a problem?

Thu, 02/09/2012 - 10:34
andreychek

If you wish to continue with the manual installation, I'd definitely prepare yourself for a lot of tinkering and troubleshooting :-)

However, if you haven't already, you'd want to go through the manual installation guide mentioned above, and perform all the configuration mentioned in it.

Also when checking mail, its saying text logins are disallowed.

Yeah, that's something the Virtualmin installer would normally correct in the dovecot config -- you'd need to make sure that "disable_plaintext_auth = no" is set in your /etc/dovecot/dovecot.conf file, and then restart Dovecot afterwards with "/etc/init.d/dovecot restart".

If you continue to get that error, it sounds like that option is still set somewhere within the Dovecot config.

Also of note, during the server test for the fetchmail, its saying the mailserver does not equal the address

Were you performing your test using SSL or TLS? That may be a SSL/TLS error, as it may have been comparing the hostname you used to connect, versus the hostname set in the SSL certificate.

-Eric

Thu, 02/09/2012 - 19:12
techforce

Ok, I added the disable_plaintext_auth = no to that file you pointed out, still same problem. That option also was in 2 other config files where I used the file manager search to locate before I did this, and thats where I had also changed that, but still, after doing this, and restarting Dovecot, same thing.

I noticed this file used the brakets { } system, which means there is actual code executing there. I merely placed that line as you pasted, not sure if it has to bein brackets? Because in my fumbling about last night, I came accross a post where someone said you can allow your specific ip address where you log in from such as xx.xx.0.0/16 and the disable_plaintext_auth = no would be valid for just that address range. Could I try that here in the file you pointed out? I cant find the article I was looking at last night anymore in my history.....

Oh, and that test was the fetchmail ' test server ' button, where you can test the server you enter for the fetchmail to execute.

Fri, 02/10/2012 - 14:35
techforce

Ok seems disable_plaintext_auth is in lots of files according to the built in search with file manager. I thought there was maybe 3 but theres more. Still getting that same error.

When I first set up the mail, there was kind of like a universal setup page where I could select the kind of system - IE: postfix, Exim , qmail - etc. There was an option for auto detect too. But I cant seem to find this page anymore in the webmin menu? Does the system really work when you switch around from different mail systems, removing and reinstalling them? So far to me seems like there are some problems with that.

Fri, 02/10/2012 - 15:17
andreychek

You may want to log in over SSH, and manually review the Dovecot config files to try and understand what's going on there.

However, it normally only takes modifying one line in order to get Dovecot to work using the plain text authentication.

Does the system really work when you switch around from different mail systems, removing and reinstalling them?

No, it's not really designed to work that way... if you switch from one mail server to another, your current mail server settings, email addresses, aliases, and the like would all be lost.

That screen is there so that, when things are first setup, you can tell it what mail server would be used -- and it would use that information so that it understands how to add email related information to the system. But it's not possible to convert from one system to another.

We'd highly recommend using Postfix.

I can't help but notice though that you've been working on getting your manual installation up and running since Sunday. And you probably still have a lot of work to go.

However, were you to start over, perform a fresh install of Ubuntu 10.04, and use the install.sh script to perform the Virtualmin installation (available in the Downloads link above), you could have this all working in an hour or two :-)

-Eric

Fri, 02/10/2012 - 16:18
techforce

Hi Eric:

           Yes, and thanks for all your help. I was thinking of the reinstall last night. 

However, I have got the websites all uploaded and working with apache, and also I installed phpmyadmin, and got it to work with the 2 sites that need sql to operate. It was not easy and one site has quite a large db that meant I had to change the max upload file size to get it to upload. Would I be able to save these settings and sql data locally on the server and still do theinstall.sh you describe ? It seems a waste to have worked on some things, got them all going that are suppose to be more difficult than just the email. I still think this entire problem ought to be investigated by the team for a possible fix in newer versions. It was really easy to break the email installation or misconfigure it. All other panels I have used, never had such a problem like this.

Fri, 02/10/2012 - 19:42
andreychek

I still think this entire problem ought to be investigated by the team for a possible fix in newer version

Well, I think your view of how Virtualmin works would be different had you used the automated installer.

Anything else, and you're not getting the designed setup. So, there's nothing we could really fix, you're not getting what was intended since you're performing the installation manually :-)

That said, we do recommend using the default Postfix mail server.

Would I be able to save these settings and sql data locally on the server and still do theinstall.sh you describe ?

That's difficult to say, I'm not entirely certain what all you did to achieve the setup you have now. On a typical Virtualmin installation, you would just go into Backup and Restore -> Backup Virtual Servers, and you could generate a backup of all the domains you have configured now, and then restore them later after performing a fresh installation.

However, since you have a non-standard manual installation, I don't understand enough about what you have going on there to assist in that process.

-Eric

Sat, 02/11/2012 - 01:12
techforce

Ok, I guess theres not much else to do. My hosting provider did the first install, so I will ask them if they used the install.sh script the first time. I will have them do a nuke of everything, install Ubuntu fresh , then post here for some more suport.

Sat, 02/11/2012 - 12:18
techforce

Ok all set. Fresh install of Ubuntu. Where do I go from here? Will we install as the user or as root? I believe the only root login I can do is the su root.....

Also, is it safe to do any OS updates now before we start with the webmin install, or do we wait until webimin is installed, then do updates?

Sat, 02/11/2012 - 18:15
andreychek

Howdy,

The short version of the install instructions are here:

http://www.virtualmin.com/download.html

But yeah, you'd just use the root user to run the install.sh script. You can certainly perform any OS updates prior to running the install.sh script.

-Eric

Sat, 02/11/2012 - 18:32
techforce

Hi:

Ok, so we begin with virtualmin? The first time, the hosting company had installed webmin, and from within that I could install virtualmin.....now kinda confused. That link you supplied seems to say that Ubuntu will have to use the manual install.....? The support guy on the server did tell me that they used their own install script for webmin.

Sat, 02/11/2012 - 20:32
andreychek

That link you supplied seems to say that Ubuntu will have to use the manual install.

Hmm, where do you see that?

You mentioned above that you were using Ubuntu 10.04, which is one of the Grade A supported distros. And as that link mentions, all the Grade A supported distros can use the automated install.sh script.

the hosting company had installed webmin, and from within that I could install virtualmin

Well, we don't recommend using that method to perform the installation, as that's essentially a manual install, and a lot of things won't work out of the box.

If you're using a Grade A supported distro, and you follow the instructions in the link I shared, you should be able to have Virtualmin up and running quickly using the automated installer, and that'll configure all the various services on your server to work correctly out of the box.

-Eric

Sat, 02/11/2012 - 21:23
techforce

I dont have any licenses, so I figure: Virtualmin GPL Downloads

[The Virtualmin GPL installation script is available for Linux and FreeBSD or for Solaris and OpenSolaris 10 and 11.]

No mention of Ubuntu?

The rest of the message under that seems to refer to the manual installation....as a webmin module..

Sat, 02/11/2012 - 21:48
andreychek

Aha, I understand the confusion now!

Ubuntu is one of several types of Linux distributions. So if you want to run Linux, you might use Ubuntu, or Debian, or CentOS -- those are all Linux distributions.

So, you just want to download the Linux version of the install.sh script, that'll work on Ubuntu Linux 10.04.

-Eric

Sat, 02/11/2012 - 23:10
techforce

Hi Eric:

Wow, you were right, that went smoothly ! I am doing the post setup now and its asking me :

[For DNS zones created by Virtualmin to be resolvable, the primary nameserver record for each zone must be set to something that can itself be resolved by other systems on the Internet.]

[Primary nameserver} () Skip check for resolvability

Secondary nameservers (optional)

Its got the server hostname they generated during I guess the Ubuntu install in there as the primary nameserver. its a (3) dot address. Since my old server used actually part of a domain I own and hosted on the server as that actual site, I used it as a hostname also with a 3 dot name...and while it worked, plesk panel thought it was a subdomain. Ought I stay away from doing that here in Webmin? The main reason I did it that way was because a Forum 2 email board in php would get alot of bounced emails back from ISP's that would do a reverse match and say that the generic machine name does not have the actual domain. Not all ISP mail servers did this, but a great majority...mostly AOL. So it seemed to improve when I actually put the domain name of that site that had the board actually in the hostname like that. For now, I dont want to deal with that domain just yet, but was wondering your thoughts on it?

Sun, 02/12/2012 - 09:35
andreychek

Howdy,

I would suggest using an FQDN (host.domain.tld) for your hostname. You would want to make sure that your hostname resolves (ie, that there is a DNS entry setup for it), and that should handle a lot of the email sending issues you were seeing.

-Eric

Sun, 02/12/2012 - 17:16
techforce

Ok, this is the part that is kinda weird. I have 3 domains I will be moving to this new server being setup. The domain that had the mail problem was the one I picked to use as the fqdn last time...it was server1.domain.tld , so if I use that domain now for this server, I cant really get it to resolve without pointing that systems dns to the new server, and right now, I just want to setup mail and http to work with the 3rd dom,ain that is the smallest site, just to get the feel of the system etc. Can that be done?

Other question I have with the mail setup is, do I need to declare a mailserver in the bind dns server for each domain? The hosting company has their own DNS interface outside of virtualmin that seems to take priority. If so, where do I setup the mail server for a domain? Is fetchmail needed with dovecot? Can you supply an example for setting up a mail account for one address? I already setup a user in users and groups as the mail address I want to use, Not as user@domain3.tld, simply as the user name. I made its main group [mail] , not sure if thats needed?

Sun, 02/12/2012 - 21:36
andreychek

Howdy,

You may want to start opening new threads as you have new questions -- I'm starting to have trouble following this long forum post :-)

However, I'll do my best to answer your questions:

I just want to setup mail and http to work with the 3rd dom,ain that is the smallest site, just to get the feel of the system etc. Can that be done?

Well, you have to setup your server with a hostname in FQDN format (host.domain.tld) that resolves. Otherwise, email is likely to bounce.

Other than that -- you can certainly host a domain with just a website and email :-)

Other question I have with the mail setup is, do I need to declare a mailserver in the bind dns server for each domain?

By default, it'll use your own server for email delivery. You'd only need to add a custom MX record in your DNS if you wish to use a third party for email delivery.

Is fetchmail needed with dovecot?

Nope!

Can you supply an example for setting up a mail account for one address?

If you want a new email user, first setup your domain in Virtualmin, then go into Edit Users, and create your new email user there.

But you'd definitely want to create your users from within Virtualmin, using Edit Users -- I don't recommend creating users outside of Virtualmin. I wouldn't recommend going into Webmin to do that either. The way you described above sounds as if you may have created your user in a way Virtualmin wouldn't know about.

If you want any email aliases along with your newly added email addresses, you can do that by going into Edit Aliases.

-Eric

Mon, 02/13/2012 - 12:43
techforce

Hi Eric:

Thanks again for the help. I got the virtual domain created, but I learned when creating it in virtualmin, the apache module over in webmin does not always work accurately with the item created in virtualmin. If I change the home directory in the webmin entry, the virtualmin entry wont pick it up. In fact, you cant point it to a different directory if it already exists as a folder, which is frustrating. So I had the domain already working in var/www/domain1 folder with all its files in domain1 folder...then when I setup the same domain in virtualmin , it let me create it, though it already existed...so I had 2 entries. I deleted the one in webmin, tried working with just the virtualmin interface, and I got my one email account going, but now the files for the site are in the webmin directory. Ok, simple move right? Nope. Cant move all those files with the java file manager, PLUS - I dont have permission to even look in the new folder virtualmin created for the new domain. Its made that folder owned by the new name of the domain I guess when I created it, and it wont let you navigate there unless I guess if you login via FTP as that new user. Kind of frustrating how all these permissions are set like that.....

Mon, 02/13/2012 - 13:15
andreychek

Howdy,

Well, you seem to be going a bit against the grain in regards to how Virtualmin works.

I'd highly recommend not making any changes in Webmin -- but instead, to find a way to work with Virtualmin's workflow.

By default, Virtualmin places websites and user accounts in /home.

That's because it configures suexec and related tools to run out of /home. Using suexec provides security advantages, since code isn't running as the Apache user, but instead runs as the account owner.

So if you try to work around Virtualmin, and make Apache run the site out of /var/www -- things won't actually work properly for you.

My recommendation then is to migrate your site to work within /home/USERNAME.

I dont have permission to even look in the new folder virtualmin created for the new domain. Its made that folder owned by the new name of the domain I guess when I created it, and it wont let you navigate there unless I guess if you login via FTP as that new user

That's correct -- a new top-level Virtual Server would setup the files so that they're only visible to users of that Virtual Server.

To most folks, that's considered a feature :-)

I would recommend using a user of that Virtual Server though in order to upload files.

Also, since suexec is being used, it would cause problems if you attempted to use a different user to modify files.

That said, if you really need to do some file management and copy files from their current location to this user's directory -- you could always use a tool like WinSCP to log in over SSH as root, and copy the files that way. But after doing so, be sure to change the ownership of the files to that of the Virtual Server owner.

-Eric

Mon, 02/13/2012 - 14:44
techforce

Ok, I thought I understood the new approach as you outlined, but maybe not, or I am just trying to do things that maybe I need to understand better. While I have that domain in the proper location /home/domain/public_html , and the email works, I went to do the same thing for one of my other domains, and it setup in the same format, but if I go to load the first domain, it fails. Its getting information from the domain folder I just entered...and I didnt change anything. This new domain still resolves to my old server, but the one I just got working with the http and email resolves to this server with virtualmin. Is that the problem? One would think that for migration purposes, we can just set up each domain one at a time via http://serverip/the domain , to make sure al the files and stuff and sql work before we actualy do the dns propogation for it all......

Mon, 02/13/2012 - 15:07
andreychek

You can read about different ways to handle the DNS propagation issues here:

http://www.virtualmin.com/documentation/web/faq

Mon, 02/13/2012 - 15:28
techforce

Ok, it was because I created the 1st virtual server with just the domain name less the .tld extension. It let me enter without a .tld and I think that was causing anything else to default back to that virtual server. So I changed it to its corresponding .tld, and same for the new virtual server, and so far the 1st domain is coming up ok. To check the second domain, I guess I have to point it to the correct public_html folder....not sure if there is a way to do that, IE: http://serverip/??domain??

Wil read up on that link you supplied, thanks again !

Tue, 02/14/2012 - 16:16
techforce

Eric: Hope you are still there for help. I want to have one open directory under /domain1/open and I created the directory then gave it R-W permissions in File manager, but if I go there, its not listing directory contents. I think by default maybe apache does this? If I wanted to permit only this directory from being open could use .htaccess, but I also think apache disables all .htaccess by default, and we would need to change that setting someplace?

Tue, 02/14/2012 - 18:52
andreychek

Well, I'm not entirely certain I understand, but it looks like you may still be going against the grain there... I don't think that's going to work the way you want :-)

If you have a Virtual Server, I'd recommend using the users within that Virtual Server to create, modify, and delete files and directories. And I'd recommend using the files/directories that Virtualmin creates for you to do all that. I wouldn't recommend trying to use a directory outside of your Virtual Server's home directory.

Not doing all that may mean you end up with strange permissions and things that don't work quite right :-)

-Eric

Wed, 02/15/2012 - 01:07
techforce

Hi Eric:

Ok, tried creating the directory as the admin user for the domain in a ftp session. It worked, but the new folder canot be accessed. its pretty much under public_html/folder for the given domain, and it appears htaccess file does not permit it to be an open directory to the world.On my old server I had this problem with plesk, and there is a setting I think in apache where by default, its disabled the htaccess files, and you can re-enable them, but I do not recall more about it at this time.

On another subject , phpmyadmin.....I notice it can only be installed for each virtual server. Does this mean each virtual server has to have its own database area? I noticed during the troubles before, I was able to instal phpmyadmin via the system command prompt, and have only one main phpmyadmin login, and each domain was able to access the databases after setting permissions and user names etc. So in regard to phpmyadmin, do you recommend using the seperate logins as per the virtualmin setup?

Wed, 02/15/2012 - 07:26
andreychek

On another subject , phpmyadmin

Due to the length of this thread, why don't you open up your new subject in a new forum post... that'll help keep me from getting confused :-)

Actually, if you have any additional questions after your directory question, it might be best to start a new thread with them. It'll help us better keep track of things :-)

It worked, but the new folder canot be accessed. its pretty much under public_html/folder for the given domain, and it appears htaccess file does not permit it to be an open directory to the world

So you're saying that you want a user to be able to browse to www.example.com/folder, and be able to see all the folder contents rather than seeing a given webpage?

That is indeed disabled by default, in the Apache "Options" line for each Virtual Server.

All you need to do is enable "Indexes" for that directory. You should be able to use a .htaccess file allow that, and .htaccess files should be enabled by default.

Try putting a .htaccess file in the directory you wish to be open, and add this line to it:

Options Indexes

And then, if that doesn't work for some reason, take a look in the error log in $HOME/logs/error_log to see if it describes the problem in there.

-Eric

Topic locked