Raspberry Pi Email Server Part 3: Squirrelmail

Powered by Drupal
Submitted by Sam Hobbs on

Squirrelmail Logo This is the third part of a five part tutorial that will show you how to install a full featured email server on your Raspberry Pi. This tutorial covers how to set up Webmail with Squirrelmail.

The parts are:

The Introduction & Contents Page (read first)

Raspberry Pi Email Server Part 1: Postfix

Raspberry Pi Email Server Part 2: Dovecot

Raspberry Pi Email Server Part 3: Squirrelmail

Raspberry Pi Email Server Part 4: Spam Detection with Spamassassin

Raspberry Pi Email Server Part 5: Spam Sorting with LMTP & Sieve

Installing Apache

If you don't already have apache installed (you might if you've followed my wordpress tutorial), then install it now.

sudo apt-get update
sudo apt-get install apache2

Enable the SSL apache module so that you can use HTTPS:

sudo a2enmod ssl

There are some "pre-made" virtualhost configurations that come with apache. This command will enable the "default-ssl" virtualhost, by creating a symbolic link from /etc/apache2/sites-available/default-ssl to /etc/apache2/sites-enabled/default-ssl:

sudo a2ensite default-ssl

Now reload apache to make the changes take effect:

sudo service apache2 reload

If you type the IP address or hostname of the pi into a web browser now, you should see the default Apache test page: apache2-test-page.png If you try the https version, you'll get a certificate error because you are using a self-signed SSL certificate. If you like, you can follow my CAcert tutorial to get a free SSL certificate for your domain, or you can just store an exception for the certificate and generate a proper one later. apache2-test-page-https.png That's it for Apache. If you want to know more about setting up Apache for multiple websites, subdomains, and SSL configurations, I suggest you read my tutorial explaining Apache's VirtualHost files.

Installing Squirrelmail

Now we need to install squirrelmail:

sudo apt-get update
sudo apt-get install squirrelmail

The basic configuration for squirrelmail is really easy, and can be done with the setup script. To run the script, use this command:

sudo squirrelmail-configure

Squirrelmail configuration menu Choose “D” for pre-defined settings Choose pre-defined server configuration Now type “dovecot” and hit enter Accept pre-defined configuration for use with Dovecot Press enter to continue, then save and quit (press Q and save when prompted, or press S then Q). The configuration script creates a configuration file for apache in /etc/squirrelmail/apache.conf. You need to create a symbolic link so that Apache2 will load your Squirrelmail apache configuration file when it starts up. On Raspbian Wheezy, the command is:

sudo ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.conf

On Raspbian Jessie, the apache configuration directory structure is more like ubuntu, with separate folders for configuration files that are available and files that are enabled. This command will create a symlink from the directory where enabled configuration is stored, to squirrelmail's apache configuration file:

sudo ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf-enabled/squirrelmail.conf

On a related note, there's a convenience command a2enconf that works similarly to a2ensite: it creates a symlink from the conf-available directory to the conf-enabled directory. You should use this in situations where config already exists in conf-available, e.g. sudo a2enconf squirrelmail would create a symlink for a file called squirrelmail.conf. Now reload Apache one more time so that it reads the config file we just symlinked:

sudo service apache2 reload

Now visit the IP address or hostname of your Pi again, but add /squirrelmail to the path, e.g. 192.168.1.174/squirrelmail, you should see the login page: squirrelmail-login_0.png The squirrelmail configuration file just adds an alias that should affect every virtualhost, so if you install a wordpress site or something like that on your pi, you will be able to get to the squirrelmail login page by visiting yourdomain.com/squirrelmail.

Redirect http to https for secure login

Since you don't want to send your login details and confidential information over the internet without SSL, it's best to redirect all http URLs to https. The default squirrelmail apache configuration file at /etc/squirrelmail/apache.conf contains some rewrite rules we can use, we just need to uncomment them. Open the file and uncomment the lines by removing the # at the start of each so that it looks like this:

<IfModule mod_rewrite.c>
  <IfModule mod_ssl.c>
    <Location /squirrelmail>
      RewriteEngine on
      RewriteCond %{HTTPS} !^on$ [NC]
      RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI}  [L]
    </Location>
  </IfModule>
</IfModule>

This configuration makes sure that the rewrite and ssl modules are enabled, and does nothing if they aren't. We already enabled the ssl module earlier, so all we need to do now is enable the rewrite module:

sudo a2enmod rewrite

And reload Apache:

sudo service apache2 reload

Now if you visit the HTTP page, you should be redirected to HTTPS.

Optional: Configuring Apache to serve Squirrelmail on a subdomain

If you would like to move the login page to the root of your domain (i.e. so that yourdomain.com would serve the login page for squirrelmail), or if you would like to serve it on a subdomain like mail.yourdomain.com, you can edit the configuration file. If not, you can skip this section. By default, this line in /etc/squirrelmail/apache.conf means that http://www.yourdomain.com/squirrelmail will load squirrelmail:

Alias /squirrelmail /usr/share/squirrelmail

If you would rather have webmail on a subdomain like mail.yourdomain.com then you could edit the /etc/squirrelmail/apache.conf file to look like this (comment out the rest):

<VirtualHost *:80>
  DocumentRoot /usr/share/squirrelmail
  ServerName mail.yourdomain.com


<Directory /usr/share/squirrelmail>
  Options FollowSymLinks
  <IfModule mod_php5.c>
    php_flag register_globals off
  </IfModule>
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>

  # access to configtest is limited by default to prevent information leak
  <Files configtest.php>
    order deny,allow
    deny from all
    allow from 127.0.0.1
  </Files>
</Directory>
</VirtualHost>

Note that if you want to serve mail on a subdomain, then that subdomain needs a DNS record, so edit your records with your DNS provider accordingly. However, the virtualhost code above only does HTTP. You also want an HTTPS virtualhost for the subdomain on port 443:

<IfModule mod_ssl.c>
<VirtualHost *:443>
  DocumentRoot /usr/share/squirrelmail
  ServerName mail.yourdomain.com

<Directory /usr/share/squirrelmail>
  Options FollowSymLinks
  <IfModule mod_php5.c>
    php_flag register_globals off
  </IfModule>
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>

  # access to configtest is limited by default to prevent information leak
  <Files configtest.php>
    order deny,allow
    deny from all
    allow from 127.0.0.1
  </Files>
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

SSLEngine on
SSLCertificateFile    /etc/ssl/certs/your-ssl-certificate.crt
SSLCertificateKeyFile /etc/ssl/private/your-ssl-certificate-keyfile.key


</VirtualHost>
</IfModule>

If you use this configuration, the rewrite rules from the "rewrite to HTTPS" section (the ones from the default config file) won't work. If you want an HTTPS-only solution, you can replace the virtualhost for port 80 with this:

<VirtualHost *:80>
ServerName mail.yourdomain.com
<IfModule mod_rewrite.c>
  <IfModule mod_ssl.c>
    <Location />
      RewriteEngine on
      RewriteCond %{HTTPS} !^on$ [NC]
      RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI}  [L]
    </Location>
  </IfModule>
</IfModule>
</VirtualHost>

As before, make sure you have the rewrite module enabled:

sudo a2enmod rewrite

Now reload apache:

sudo service apache2 restart

If you get an error like this:

[....] Restarting web server: apache2[Fri Dec 06 15:54:04 2013] [warn] _default_ VirtualHost overlap on port 443, the first has precedence

Then add NameVirtualHost *:443 to the start of the SSL VirtualHost block, i.e.:

NameVirtualHost *:443
<IfModule mod_ssl.c>
<VirtualHost *:443>
  DocumentRoot /usr/share/squirrelmail
  ServerName mail.yourdomain.com
...

For more info on HTTP and HTTPS VirtualHost configuration on Apache2, see this tutorial of mine. If all went to plan then you can navigate to mail.yourdomain.com and you should see the squirrelmail login page (you might need to forward some ports on your router if you haven't already - see the next section): Squirrelmail login page

Port Forwarding

Squirrelmail will log in to your IMAP server on port 143 to display your emails. It doesn’t need to authenticate because it’s in your network (remember the permit_mynetworks parameter from the previous tutorials?). You don’t need to worry about it being an unencrypted connection, because the data isn't actually travelling over any insecure networks (the connection is internal). Similarly, you don’t need to open port 143 (“plain” imap without SSL/TLS) on your router because the connection happens within the Pi, and the content is actually served to you, the user, on port 443 (https). So you do need to open ports 80 and 443 for http and https like below: Port forwarding rules

Testing

Before you start testing your webmail, make sure that the permit_mynetworks parameters are uncommented in your postfix confuguration file /etc/postfix/main.cf (in both your smtpd_recipient_restrictions and smtpd_helo_restrictions). Now reload your postfix configuration:

sudo service postfix reload

Try sending and receiving emails from within Squirrelmail. You should have no problems, but if you do please post a comment and I’ll try to help you out.

Customising the Squirrelmail Login

To customise the login page, run the configuration wizard:

sudo squirrelmail-configure
  1. Select “1″ (organisation preferences)
  2. Select “7″ and change to your domain (e.g. http://www.samhobbs.co.uk)
  3. Select “8″ and change to you/your organisation’s name

Squirrelmail Plugins

There are loads of plugins available for Squirrelmail, for all kinds of things. On most systems, these plugins are installed by downloading a .zip file to your server, unzipping the plugin to the right location and then tinkering with the settings manually. Thankfully, some of the most commonly used plugins are available from the Raspbian repositories, so installation is much simpler. Here is a list of the plugins in the repo:

  1. squirrelmail-compatibility
  2. squirrelmail-decode
  3. squirrelmail-locales
  4. squirrelmail-lockout
  5. squirrelmail-logger
  6. squirrelmail-quicksave
  7. squirrelmail-secure-login
  8. squirrelmail-sent-confirmation
  9. squirrelmail-spam-buttons
  10. squirrelmail-viewashtml

The one I think is most useful and the one I’m going to use as an example is lockout. To use the lockout package, we need to install the compatibility package, which basically makes sure that plugins built for different versions of squirrelmail can still work with the version you are running.

sudo apt-get update
sudo apt-get install squirrelmail-compatibility

Now we need to enable the plugin:

sudo squirrelmail-configure
  1. select “8″
  2. select “compatibility”
  3. select “S” (to save)
  4. select “Q” (to quit)

That’s all you need to do for the compatibility plugin. Now we can install the lockout plugin:

sudo apt-get install squirrelmail-lockout

Now for the configuration:

sudo squirrelmail-configure

Make sure that lockout is enabled Now we can manually edit some settings. Before starting, I like to back up the default config files for reference:

cd /etc/squirrelmail
sudo cp lockout-table.php lockout-table.php.BAK
sudo cp lockout-config.php lockout-config.php.BAK

Now edit the lockout-table.php file. Read the comments in the file for an explanation of how the table works. I wanted to disable logins for the user “admin”, so I commented out the examples at the end of the file and replaced them with this:

user:		admin		locked_out.php

Now edit lockout-config.php and set $use_lockout_rules = 1; to turn on lockouts. Now try and log in as the user you locked out, and you should get this message: “Access Denied / Please contact your system administrator”. We can also lock out IP addresses of users who enter incorrect username/password combinations repeatedly. To do this, open lockout-config.php and set $max_login_attempts_per_IP = '3:5:0'. The first number in this parameter is the number of incorrect attempts that are allowed before a ban. The second number is the time frame for these incorrect attempts, and the last number is the amount of time the ban lasts for when activated (0 is forever). So, the setting I gave you above means that anyone who makes 3 incorrect attempts to authenticate in 5 minutes is permanently banned. When a successful login is made, the count is reset to 0. Data on current bad login attempts and bans is stored here: /var/lib/squirrelmail/data/lockout_plugin_login_failure_information The plugin will add entries like this to keep track of bad logins:

999.999.99.99_login_failure_times=1386774015:1386774034:1386774053
999.999.99.99_TOO_MANY_FAILED_LOGIN_ATTEMPTS=PERMANENT

…where 999.999.99.99 is the offending IP address If you accidentally ban yourself, you’ll have to log in via SSH and edit this file to remove those lines. That’s it, you’re done! Have fun exploring the other plugins! The next two tutorials, Part 4 and Part 5 deal with spam detection and filtering.

Comments

Hi Brian, Sounds like a permissions/ownership issue, but I'm not sure - If I were you I would start by taking a look at the permissions for that directory:
ls -l /var/lib/squirrelmail/data
Have you changed any permissions or ownership for any of the squirrelmail files? If that leads you nowhere I'd look at the virtualhost file next. Sam

Hi Sam, I solved the problem with Dovecot.
Now, Squirrelmail is ok, but I have a problem when I login into the mail-server:
ERROR: Could not complete request.
Query: SELECT "INBOX"
Reason Given: [SERVERBUG] Internal error occurred. Refer to server log for more information. [2014-11-29 09:23:33]

Thank you for the tutorial.

Hello,
Can help me, after this steps squirrelmail is default website in my apache? Then didn't work my website in my root folder.
How I can change that squirrelmail won't default website?
Mac

This is the error in the file mail.log

Error: open(/var/mail/testmail) failed: Permission denied (euid=1002(testmail) egid=1005(testmail) missing +$ perm: /var/mail, we're not in group 8(mail), dir owned by 0:8 mode=0775)
Nov 30 10:20:43 server dovecot: imap(testmail): Error: Opening INBOX failed: Mailbox doesn't exist: INBOX

If I navigate to /var/mail the is no file or directory...

This is the permission of testmail (the account that I have access to the web login page)

total 8
drwx------ 3 testmail testmail 4096 Nov 28 14:24 mail
drwx------ 10 testmail testmail 4096 Nov 27 17:31 Maildir
lrwxrwxrwx 1 testmail testmail 44 Nov 27 17:31 pistore.desktop -> /usr/share/indiecity/pistore/pistore.desktop

Thank you.

Looks like the program is looking for a mailbox in /var/mail when you should be looking in /home/user/Maildir. Are you sure you did the "Tell Dovecot where your Mailbox is" stage in part 2? I.e.
Open /etc/dovecot/conf.d/10-mail.conf and find this line:
mail_location = mbox:~/mail:INBOX=/var/mail/%u
Change it to this:
mail_location = maildir:~/Maildir
Sam

Thank you again Sam! Now It works!
I use a DNS service (No-Ip), free hostname as DNS Host for example: example.ddns.net. I set MX records and I put my site (ever No-IP, the same example.ddns.net) but I don't know about the numbers between the form for the MX record...

Good stuff :) Just to be clear, what you are using is a dynamic DNS service, which is not quite the same as "normal" DNS. The dynamic bit means the DNS records are updated periodically if your IP address changes. Can you take a screenshot of the settings page? If the numbers are for priorities, you can put pretty much anything in there. MX records can specify a list of servers to be tried in a specific order (so if you were a big company you could have a few different servers to spread the load). None of this matters if you only use one server, since there is only one choice. Sam

I can send but not receive e-mails. I try to send an e-mail to the same address and It works; I try send an e-mail from another email address and it not works... Do I reconfigure Postfix?

Thank you.

Adrian Rees

Tue, 12/02/2014 - 15:44

Hi Sam
I want to setup my RasPi to act as an email server, and your tutorials are spot on !

I have email being sent & received from two ISP domains on the internet. I need to be able to send & receive to these two domains when I am away from home and / or the internet connection to my RasPi has failed. I roam around alot with work, so how can I configure my home based Raspi email server to send & receive email to and from these two domains (on the Internet) yet leave emails on the two internet domains? So an email solution that is a client and server at the same time...?

Cheers

A

When you say ISP domains, do you mean an ISP email account, or a domain that your ISP is the DNS provider for? It's certainly possible to do this with Postfix but I haven't done it myself so I can't give you a detailed guide. You can send email claiming to be from any domain using any email server, but it might be flagged as spam if the IP address of your Pi doesn't correspond to an IP address on the DNS A or MX record for that domain. If you are sending using an ISP email account, have a look at this comment about relaying through your ISP's email server. You might also like to use Fetchmail to retrieve mail from your other accounts to your Pi using POP or IMAP (so you can log in to your Pi to receive all your mail) but I don't have any guides for that. Hope that helps! Sam

Matthew Horton

Wed, 01/14/2015 - 09:39

hi sam,

wicked tutorials. really helping me out as i will use the server to provide email for a few clients. thank you.

i am just about to start the optional stage in this tutorial after forcing the use of https. i wanted to test that https was working so i tried to load the page: https://hortonmail.ddns.net/squirrelmail and my browser says 'page not found'

also, when i do: 'sudo service apache2 reload' i get this message:

[....] Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
. ok

I'm not sure if these are related?

Many thanks,
Matt

It's not related - that's a warning rather than an error. If you put ServerName foo in your apache configuration somewhere it will use "foo" as the name instead. Are you sure you enabled the SSL module, and a configuration file that has SSL configuration in it? If you could run these commands and post the output it would help me:
sudo a2enmod ssl
sudo service apache2 restart
ls -l /etc/apache2/sites-enabled
Sam

hi, thanks for your reply!

here is the output:

pi@raspi ~ $ sudo a2enmod ssl
Module ssl already enabled
pi@raspi ~ $ sudo service apache2 restart
[....] Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting .apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
. ok
pi@raspi ~ $ ls -l /etc/apache2/sites-enabled
total 0
lrwxrwxrwx 1 root root 26 Jan 8 11:37 000-default -> ../sites-available/default

many thanks, matt

OK that all looks fine. Unless you put your SSL configuration in 000-default, you need to run:
sudo a2enconf default-ssl
... to create a symlink from sites-available to sites-enabled, and then restart Apache. Sam

i ran:
"sudo a2enconf default-ssl"
but it came up with the error:
"sudo: a2enconf: command not found"

so i guessed that you might have meant:
"sudo a2ensite default-ssl"

so i ran that and restarted apache.

now when i type "ls -l /etc/apache2/sites-enabled", i get an extra line:

total 0
lrwxrwxrwx 1 root root 26 Jan 8 11:37 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 30 Jan 15 08:56 default-ssl -> ../sites-available/default-ssl

this doesn't seem to resolve the problem though.

this is what happens from my local browser:

With ip address:

http://192.168.0.2/ - WORKS
http://192.168.0.2/squirrelmail - WORKS (redirects to https)

https://192.168.0.2/ - WORKS
https://192.168.0.2/squirrelmail - WORKS

but with domain name:

http://hortonmail.ddns.net/ - WORKS
http://hortonmail.ddns.net/squirrelmail - "Cannot connect to destination (hortonmail.ddns.net)" (doesn't force https)

https://hortonmail.ddns.net/ - "Cannot connect to destination (hortonmail.ddns.net)"
https://hortonmail.ddns.net/squirrelmail - "Cannot connect to destination (hortonmail.ddns.net)"

Many thanks,
Matt

Sorry about that, you're right I meant a2ensite - that was the tiredness talking. Since you can access it from your LAN but not WAN, it sounds like you might not have forwarded port 443 to the pi on your router, can you check that and report back please? Sam

I have followed all of your instructions and for some reason cannot send email, however if I have received an email and reply to it, this will be sent... Any ideas?

Thanks :)

Sam Hobbs

Fri, 01/23/2015 - 18:39

Is this squirrelmail specific or do you have the same problem with your regular email clients? Have you had a look in your mail log?
less /var/log/mail.log
Sam

I have one pi running owncloud and one pi running email server. owncloud pi has port 443 forwarded to it. email server pi has ports 25, 465, and 993 forwarded to it. The both work fine.

Now I want to install Squirrelmail.

You mentioned: "If you have owncloud on another pi with ports 80/443 forwarded to it you might want to put squirrelmail on there (because you can't forward the same port to more than one pi). Squirrelmail is just like a normal email client with a web interface, you'll just have to make sure you put the right connection settings into it during configuration (either your domain name or the local IP of the mail server pi instead of localhost)."

Where exactly are the connection settings for Squirrelmail where I put either domain name or local IP of the mail server pi instead of localhost?

You should get an option to do that we then you run squirrelmail-configure. Not used it myself though. You'll want to configure it to use the same ports (993, 465) as your email client since the PW will be sent across a network, even if it is just your LAN! Sam

I have the email server and owncloud on separate pi's both are working fine.

I installed squirrelmail on the owncloud pi which has the apache server and ports 80, and 443 forwarded to it.

Here is my squirrelmail configuration
1. Domain : mydomain.com
2. Invert Time : false
3. Sendmail or SMTP : SMTP

IMAP Settings
--------------
4. IMAP Server : localhost
5. IMAP Port : 993
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : dovecot
9. Delimiter : detect

SMTP Settings
-------------
4. SMTP Server : localhost
5. SMTP Port : 465
6. POP before SMTP : false
7. SMTP Authentication : none
8. Secure SMTP (TLS) : false
9. Header encryption key :

Restarted owncloud pi.

When I visit https://mydomain.com/squirrelmail and try to log in I get.
ERROR
Error connecting to IMAP server: localhost.
111 : Connection refused

Any ideas?

I got it to work finally with these settings in squirrelmail configuration (I think you told me to do this before) :(

1. Domain : mydomain.com
2. Invert Time : false
3. Sendmail or SMTP : SMTP

IMAP Settings
4. IMAP Server : mydomain.com
5. IMAP Port : 993
6. Authentication type : login
7. Secure IMAP (TLS) : true
8. Server software : dovecot
9. Delimiter : detect

SMTP Settings
4. SMTP Server : mydomain.com
5. SMTP Port : 465
6. POP before SMTP : false
7. SMTP Authentication : none
8. Secure SMTP (TLS) : false
9. Header encryption key :

I'm glad I have etckeeper installed to keep track of this! :)

Now, one last question (do you really believe it will be the last?)

I now get to owncloud through https://mydomain.com and email server through https://mdomain.com/squirrelmail.

I would like to get to owncloud with https://mydomain.com/owncloud (shouldn't have moved it during installation)

So somehow (I guess) I have to move ALL this stuff back into /var/www/owncloud. Right???
pi@ownCloud /var/www $ ls -alt
total 160
drwxr-xr-x 3 www-data www-data 4096 Jan 1 12:10 themes
drwxr-xr-x 11 www-data www-data 4096 Jan 1 12:07 .
-rw-r--r-- 1 www-data www-data 1525 Jan 1 12:07 dead.letter
-rw-r--r-- 1 www-data www-data 1376 Dec 31 20:45 .htaccess
lrwxrwxrwx 1 root root 22 Dec 31 16:09 config -> /media/owncloud/config
lrwxrwxrwx 1 root root 20 Dec 31 16:09 data -> /media/owncloud/data
-rw-r--r-- 1 www-data www-data 34520 Dec 31 15:38 COPYING-AGPL
-rw-r--r-- 1 www-data www-data 3929 Dec 31 15:38 cron.php
-rw-r--r-- 1 www-data www-data 2595 Dec 31 15:38 indie.json
-rw-r--r-- 1 www-data www-data 1735 Dec 31 15:38 remote.php
-rw-r--r-- 1 www-data www-data 149 Dec 31 15:38 version.php
-rw-r--r-- 1 www-data www-data 586 Dec 31 15:38 AUTHORS
-rw-r--r-- 1 www-data www-data 179 Dec 31 15:38 index.html
-rw-r--r-- 1 www-data www-data 1753 Dec 31 15:38 public.php
-rw-r--r-- 1 www-data www-data 1406 Dec 31 15:38 status.php
drwxr-xr-x 27 www-data www-data 4096 Dec 31 15:38 3rdparty
-rw-r--r-- 1 www-data www-data 23751 Dec 31 15:37 db_structure.xml
-rw-r--r-- 1 www-data www-data 1281 Dec 31 15:37 index.php
drwxr-xr-x 6 www-data www-data 4096 Dec 31 15:37 lib
drwxr-xr-x 123 www-data www-data 4096 Dec 31 15:37 l10n
drwxr-xr-x 11 www-data www-data 4096 Dec 31 15:37 settings
drwxr-xr-x 6 www-data www-data 4096 Dec 31 15:37 search
drwxr-xr-x 26 www-data www-data 4096 Dec 31 15:37 apps
drwxr-xr-x 16 www-data www-data 4096 Dec 31 15:37 core
-rw-r--r-- 1 www-data www-data 279 Dec 31 15:37 occ
-rw-r--r-- 1 www-data www-data 1283 Dec 31 15:37 console.php
drwxr-xr-x 2 www-data www-data 4096 Dec 31 15:37 ocs
-rw-r--r-- 1 www-data www-data 26 Dec 31 15:37 robots.txt
drwxr-xr-x 12 root root 4096 Dec 31 15:28 ..

I could probably figure how to move it, but I want to make sure that I need to move it all and this is the only thing I need to do?

What do you want to serve on your root domain now? I'd say it's best to move the owncloud stuff just to your structure inside /var/www is consistent with how you're serving stuff to users, but you don't actually have to move it - you can change which content is served where using your virtualhost file (you could create a new folder /var/www/newroot and serve that as DocumentRoot, then add aliases for /squirrelmail and /owncloud to their folders... but you might get some strange behaviour, for example if you browsed to yourdomain.com/owncloud/squirrelmail under this setup you'd get squirrelmail, since /owncloud would point to /var/www/ and squirrelmail is a folder inside that! So... move it if you can. Make sure apache2 is stopped during the move or owncloud will freak out, and if you can avoid moving the actual files you're syncing that's much better. If you move the files in data, owncloud sees the moved files as new and syncs them to all attached devices again, which takes ages! Sam

Add new comment

The content of this field is kept private and will not be shown publicly.

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.