Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all, I installed and hopefully properly configured squirrelmail and apache but when I browse example.com or IP_address I get the apache's IT WORKED page...my /etc/httpd/conf/httpd.conf file has port 80 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Location
    Harare
    Posts
    5

    Unhappy Squirrelmail and Apache Config Help


    Hi all, I installed and hopefully properly configured squirrelmail and apache but when I browse example.com or IP_address I get the apache's IT WORKED page...my /etc/httpd/conf/httpd.conf file has port 80 defined and I added my ServerName example.com. My squirrelmail configs are as follows:

    SquirrelMail Configuration : Read: config.php (1.4.0)
    ---------------------------------------------------------
    Organization Preferences
    1. Organization Name : Company Name
    2. Organization Logo : ../images/sm_logo.png
    3. Org. Logo Width/Height : (308/111)
    4. Organization Title : Company Name Webmail
    5. Signout Page :
    6. Top Frame : _top
    7. Provider link : example.com
    8. Provider name : Company Name

    Server Settings

    General
    -------
    1. Domain : example.com
    2. Invert Time : false
    3. Sendmail or SMTP : SMTP

    A. Update IMAP Settings : localhost:143 (uw)
    B. Update SMTP Settings : localhost:25

    Is there anything else that I did not do???

  2. #2
    Linux Newbie
    Join Date
    Nov 2009
    Posts
    214
    Suck it and see!

    Have you tried it out?

  3. #3
    Just Joined!
    Join Date
    Dec 2009
    Location
    California
    Posts
    98
    Yes, you need to configure a virtual host statement in your httpd.conf. Mine looks like this:

    <VirtualHost *:80>
    ServerName webmail.unixpeople.com
    ServerAlias webmail.emcscientific.com
    ServerAlias annie.unixpeople.com
    ServerAdmin freddie@unixpeople.com
    DocumentRoot /opt/apacheTenants/webmail.unixpeople.com/htdocs
    DirectoryIndex index.html index.php
    Options Indexes
    </VirtualHost>

    Notice how this forces apache to look in a different location for its document root when I type in webmail.unixpeople.com into my browser. Of course, this further assumes that webmail.unixpeople.com resolves in DNS.

    Lastly, if you don't really care about virtual hosts and you want your server to only serve webmail, then just search for the DoicumentRoot statement in httpd.conf and change it to point to your squirrelmail dir.

  4. #4
    Just Joined!
    Join Date
    Feb 2013
    Posts
    9
    Just a few extra questions so I know what else you have configured and what step you are missing:

    1. are you using any server monitoring software, such as ISPConfig, or is this just a simple web and mail machine?

    2. did you edit the squirrelmail.conf to be loaded by apache and follow symlinks as well as add the aliases?

    3. did you add "/squirrelmail" after your domain.com?

    4. is this an open-vz container?

    5. did you follow anyone's guide for this? if so, who's guide and what deviations did you make from it (if any)?

    since I will not likely be available for a few days or longer, I will post some code here for you to check over, and see what applies to your case. The code is for debian linux, specifically ubuntu 12.04 LTS. My setup includes ISPConfig 3, so a couple of things may or may not be used the same way or at all in your case:

    Move to the apache2 config directory, and make a symbolic link to squirrelmail.conf
    Code:
    cd /etc/apache2/conf.d/
    ln -s ../../squirrelmail/apache.conf squirrelmail.conf
    /etc/init.d/apache2 reload
    edit this configuration file that apache now utilizes and relies upon for squirrelmail handling
    Code:
    vi /etc/apache2/conf.d/squirrelmail.conf
    It needs to look like this:
    Code:
    ...
    <Directory /usr/share/squirrelmail>
      Options FollowSymLinks
      <IfModule mod_php5.c>
     AddType application/x-httpd-php .php
        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_admin_flag allow_url_fopen Off
        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/squirrelmail/tmp
        php_admin_value open_basedir /usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/etc/hostname:/etc/mailname:/var/spool/squirrelmail
        php_flag register_globals off
    ...
    now make a temporary directory for squirrelmail
    Code:
    mkdir /var/lib/squirrelmail/tmp
    make the apache2 user www-data own this new directory
    Code:
    chown www-data /var/lib/squirrelmail/tmp
    restart apache
    Code:
    /etc/init.d/apache2 reload
    If all is well so far, edit the squirrelmail.conf file again, and add some new aliases ## see notes just below this command
    Code:
    vi /etc/apache2/conf.d/squirrelmail.conf
    the aliases you create for apache will redirect the browser to the squirrelmail index.php login file, and squirrelmail has a built-in jail for it's sub-directories.
    the syntax for the alias is "Alias" "/alias-directory" "location-to-squirrelmail-directory". here are a couple aliases that you can use for sub-directory access to squirrelmail:
    Alias /squirrelmail /usr/share/squirrelmail
    Alias /webmail /usr/share/squirrelmail

    please note that "/mail" is NOT allowed here as it will confuse and break apache. if you insist that you need to use "mail", then use the sub-domain access for this instead.

    Also note that the commented section below the symlink scripting is (1)for use on returning a logged out user to an https secured login page instead of the typical http plain access; (2)for editing a virtual machine's ip address if it is used as part of or completely as the mail server machine; and (3)for specifying the use of a sub-domain that was created for the mail alias instead of sub-directory access (ie "mail.example.com" instead of "example.com/webmail"). Since I use ISPConfig 3, I made the sub-domain alias "mail.my-domain.com" via ISPConfig, and made it redirect to the squirrelmail url for my web server. This is a purely cosmetic approach since the sub-domain is not really a sub-domain until I add another apache2 server under my ISPConfig server group, and make my mail server just for mail, thereby changing its hostname to "mail" (in "mail.my-domain.com") so it is accessed as such. For that kind of configuration and setup on the mail server, you will not need any aliases whatsoever nor need to point any sub-domains to the squirrelmail directory, you will only need to have your html pages that will link to the mail login point to "mail.example.com/squirrelmail" (squirrelmail will redirect from there) and make "index.html" of your mail's webserver redirect to this as well for base directory security (unless you really want a different page to be displayed here that won't be used to log in).

    now reload apache one more time, and you should be ready to test squirrelmail
    Code:
    /etc/init.d/apache2 reload
    Navigate to "your-domain.com/squirrelmail". if you don't have a domain name server in your server network that can allow you to access your server by domain name from within the network, then simply use the network IP address instead (see below, again), but be sure you have port forwarding from where you are accessing it from (some people's network topologies are really gnarly).

    I don't mean to treat anyone like they are dumb or don't know anything, but some people actually learn how to setup a server without understanding networking, so they get really confused or brick-walled if their network is bigger than just a simple 1-modem 1-router server DMZ'ed. I have more than 1 router (I use up to 5 depending on what I am hosting at the time), so network hardware and interface knowledge and understanding are pretty much a requirement for my setups. Just in case you are under a network setup that uses more than a single router (and you don't know much about networking, sub-nets, how port-forwarding works, etc.), you will need to understand that you may not be able to access another computer you port-forward to by it's IP address if you are not on the same router. Requests sent to a host on a specific port will be forwarded up the network and through the gateway using the shortest path, but will stop if they get routed to go back down another router (a different sub-net) unless port-forwarding rules exist. I have no doubt that you already port-forwarded everywhere it was necessary, but accessing the LAN IP address of the server may be confusing for some who use a complex network layout. If you need to access a port-forwarded address that is on another sub-net that is not in the line from you to the internet gateway, then you need to use the IP address of the top-most router that is in that line that the server is under. I know the words are confusing, so I added a diagram:

    Complex-Network-Server-Model.jpg

    You won't be able to access anything below 192.168.1.1 by its assigned IP address unless all routers in the line to it have a DNS they can use that knows the entire path it needs to go through (not likely you have one for this). Instead, we simply go up the gateways until we reach the top-most router above the server that is part of the same sub-net we are under. In this case, it is 192.168.1.1, but we aren't on it's sub-net, so we can't access it's sub-net using 192.168.1.x. However, we can just access the router itself, using the IP address assigned to it by the router above both of us (192.168.0.1), so we type 192.168.0.2 to access it. Since port 80 is forwarded already down the chain to the server on the router (and hopefully the one beneath it to the server's assigned IP address), we will get forwarded all the way down. Remember that as you go up the routers, you become part of the next router's sub-net, and if the server is part of the sub-net you would be passed up to, you can access it by it's LAN IP address because you are under a router that knows its IP address. I hope this clears up any confusion for networking that wasn't already known. I did this for the viewers who are just learning and read this thread so they have more understanding of how to do these things, and what they can do with a network.

    In a nutshell, just act like the server's top-most router you share a sub-net with is the server, so type the IP address of that router to get forwarded back down the server sub-net(s).

    I sincerely hope this helps you on your problem, and anything else you may encounter in the future.

  5. #5
    Just Joined!
    Join Date
    Oct 2010
    Location
    Harare
    Posts
    5
    Wow am definitely in the right place for assistance many thanks for your responses, seems to be making headway almost there, here's what I did.
    Like abarclay said

    <VirtualHost *:80>
    ServerAdmin root@example.com
    DocumentRoot /var/www/html
    ServerName IP_Address
    ErrorLog /var/log/squirrelmail/error_log
    TransferLog /var/log//squirrelmail/access_log
    </VirtualHost>

    Now what I get when I try browse example.com or IP_Address is this
    Forbidden
    You don't have permission to access / on this server.

    and my error log reports the following:
    Directory index forbidden by rule: /var/www/html/

    However I created in /var/www/html a file called index.html wrote a bunch of staff in it and I can see the contents of that file when I browse example.com or IP_Address. This to made me assume that I am somehow supposed to create a symlink something to this. HELP...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •