DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th February 2009
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default Apache 2.2 + vhosts

Hi,

I've been struggling with this for a while..

Running FreeBSD 7.1, Apache 2.2 - trying to create some vhosts for my domain - like for example mail.mydomain.net, lists.mydomain.net, etc..

This is what I've done so far - I've changed only this to /usr/local/etc/apache22/httpd.conf
Code:
Listen 80

ServerAdmin admin@mydomain.net
ServerName mydomain.net:80

# Virtual hosts
Include etc/apache22/extra/httpd-vhosts.conf

Include etc/apache22/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Everything else is set by default.

And this is the /usr/local/etc/apache22/extra/httpd-vhosts.conf
Code:
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin admin@mydomain.net
    DocumentRoot "/usr/local/www/apache22/data"
    ServerName www.mydomain.net
    ServerAlias mydomain.net www.mydomain.org
    <Directory "/usr/local/www/apache22/data">
      AllowOverride None
      Options None
      Order allow,deny
      Allow from all
    </Directory>
    ErrorLog /var/log/httpd-error.log
    CustomLog /var/log/httpd-access.log combined
</VirtualHost>

# Mailman mailing list domain.
#
<VirtualHost *:80>
    ServerAdmin admin@mydomain.net
    DocumentRoot "/usr/local/mailman"
    ServerName lists.mydomain.net
    ServerAlias lists.mydomain.net
    ScriptAlias /cgi-bin/ "/usr/local/mailman/cgi-bin/"
    ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
    Alias /pipermail "/usr/local/mailman/archives/public"
    Alias /icons "/usr/local/mailman/icons"
    <Directory "/usr/local/mailman">
       AllowOverride All
       Options FollowSymlinks
       Order allow,deny
       Allow from all
    </Directory>
    ErrorLog /var/log/httpd-error.log
    CustomLog /var/log/httpd-access.log combined
</VirtualHost>
The problem is that if I go to http://www.lists.mydomain.net/ or http://lists.mydomain.net/mailman/listinfo ( this is still a fresh install of mailman, btw ) I get "Page Load Error" in Firefox ( or any other browser )

This is the output from httpd -S
Code:
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443          www.mydomain.net (/usr/local/etc/apache22/extra/httpd-ssl.conf:74)
*:80                   is a NameVirtualHost
         default server www.mydomain.org (/usr/local/etc/apache22/extra/httpd-vhosts.conf:30)
         port 80 namevhost www.mydomain.net (/usr/local/etc/apache22/extra/httpd-vhosts.conf:30)
         port 80 namevhost lists.mydomain.net (/usr/local/etc/apache22/extra/httpd-vhosts.conf:47)
Syntax OK
Here mydomain.net is a real registered domain. Nothing in the logs. Can't figure out what is wrong? Any help?

Thanks!
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
  #2   (View Single Post)  
Old 15th February 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Default

Are you sure the VirtualHost setting for Mailman is correct? I have these settings in mine:

Code:
<Directory /usr/local/mailman/cgi-bin>
Order Allow,Deny
Allow from all
Options ExecCGI
</Directory>

Reply With Quote
  #3   (View Single Post)  
Old 15th February 2009
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Thanks, for the quick reply!

I've tried this way too..
Code:
<VirtualHost *:80>
    ServerAdmin admin@mydomain.net
    DocumentRoot "/usr/local/mailman/cgi-bin"
    ServerName lists.mydomain.net
    ServerAlias lists.mydomain.net
    #ScriptAlias /cgi-bin/ "/usr/local/mailman/cgi-bin/"
    #ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
    #Alias /pipermail "/usr/local/mailman/archives/public"
    #Alias /icons "/usr/local/mailman/icons"
    <Directory /usr/local/mailman/cgi-bin>
       Order Allow,Deny
       Allow from all
       Options ExecCGI
    </Directory>

    ErrorLog /var/log/httpd-error.log
    CustomLog /var/log/httpd-access.log combined
</VirtualHost>
After that tried without the comments, changed the DocumentRoot to "/usr/local/mailman" - nothing... Still nothing in the logs - seems that for Apache everything is working fine..

Any other tips?
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
  #4   (View Single Post)  
Old 15th February 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Default

ServerName lists.mydomain.net
ServerAlias lists.mydomain.net

Not sure if it matters, but are you actually using identical names?
Reply With Quote
  #5   (View Single Post)  
Old 15th February 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Default

You shouldn't comment out those mailman lines. You'll need these ScriptAlias lines and the Directory settings to allow CGI execution.

This is all I have:

Code:
<VirtualHost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /usr/local/www/apache22/data
ServerName mailman.domain.com
ServerAlias lists.domain.com
ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
Alias /pipermail "/usr/local/mailman/archives/public"
CustomLog /var/log/mailman.domain.com/httpd-access.log combined
<Directory /usr/local/mailman/cgi-bin>
Order Allow,Deny
Allow from all
Options ExecCGI
</Directory>
</VirtualHost>

Last edited by DutchDaemon; 15th February 2009 at 01:24 AM.
Reply With Quote
  #6   (View Single Post)  
Old 15th February 2009
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

I have just tested your vhost config - and still no luck

The problem must be somewhere else... Nothing is actually written to /var/log/mailman.domain.com/httpd-access.log - the file is just empty. Nothing on the other logs at /var/log/httpd-* too..

By the way, I'm not running a DNS server, if that matters.
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
  #7   (View Single Post)  
Old 15th February 2009
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Ok, I've found what is the problem. Seems that last night I was too tired to notice this (forgot to mention that here too) - my webserver is behind a firewall using PF.

My public IP which is registered to the domain is assigned to the BSD gateway, which redirects all the external HTTP requests to the internal web server.

webserver -> IP 10.x.x.x
gateway -> IP <nn.ss.hh.hh.> points to mydomain.net

From the internal network I just use the "hosts" file on the systems to assign a specific IPs to a specific hosts - I don't really need a DNS server for this one since the internal network is quite small.

What I was trying to do is to access the webserver from the internal network - after adding an entry to the locals "hosts" files everything is fine. The access from the outside was working too - I just couldn't test it last night, so I guess that was the problem

Thanks again!

EDIT:

When I go to http://lists.mydomain.net/mailman/listinfo it works, how to make it work when I enter http://lists.mydomain.net/

Should I use redirecting with .php or .html pages?
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org

Last edited by DNAeon; 15th February 2009 at 12:23 PM.
Reply With Quote
  #8   (View Single Post)  
Old 15th February 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Default

You can't redirect a 'top URL' to a 'deep URL' in Apache itself, so you can't do, e.g.

Code:
Redirect / http://mailman.example.com/mailman/listinfo/
in the mailman.example.com vhost config

You can redirect a different vhost like http://list.example.com or http://mailman.example.com to http://lists.example.com/mailman/listinfo/ though.

Using a redirecting .html page in the DocumentRoot should work.

Last edited by DutchDaemon; 15th February 2009 at 01:05 PM.
Reply With Quote
  #9   (View Single Post)  
Old 15th February 2009
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Yeap, as I thought

Thanks!
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
Old 15th February 2009
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Oopps.. No there seems to be another issue with mailman..

I have subscribed some test mail accounts on my test-mailing list - 2 of the mail accounts are external (gmail and yahoo), and one is from my domain (user@mydomain.net).

I can send to the test-mailing list with no problems from the user@mydomain.net account, and the gmail and yahoo accounts receive the message, but when I try to send a message from any external account like gmail or yahoo the message is never to be delivered.

Still looking in the logs - nothing. Started tcpdump on both interfaces - on the gateway and webserver just to see if there is something blocked - nothing..

I'm lost.. Any advice?
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
Old 15th February 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Default

I'm starting to wonder which logs you're referring to. As far as Mailman's concerned, you can't get more detail than what's in the /usr/local/mailman/logs directory.
Reply With Quote
Old 16th February 2009
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

I'm looking in /var/log/maillog, /usr/local/mailman/logs/ - nothing interesting

I'll start from the beginning - this is what I did to configure mailman

1. installed mailman from ports, enabled mailman in /etc/rc.conf
2. downloaded http://www.gurulabs.com/downloads/po...mailman-2.1.py and moved it to /usr/local/mailman/, made it executable and owned by mailman user and group

3. edited postfix-to-mailman.py script
Code:
! #/usr/local/bin/python

MailmanHome = “/usr/local/mailman“; # Mailman home directory.
MailmanOwner = “postmaster@mydomain.net"; # Postmaster and abuse mail recipient.
4. /usr/local/etc/postfix/main.cf
Code:
relay_domains = proxy:mysql:/usr/local/etc/postfix mysql_relay_domains_maps.cf lists.mydomain.net

# TRANSPORT MAP
#
# See the discussion in the ADDRESS_REWRITING_README document.
transport_maps = hash:/usr/local/etc/postfix/transport
vacation_destination_recipient_limit = 1
mailman_destination_recipient_limit = 1
5. echo 'lists.mydomain.net mailman:' >> /usr/local/etc/postfix/transport

6. added this to /usr/local/etc/postfix/master.cf
Code:
mailman unix - n n - - pipe
  flags=FR user=mailman:mailman
  argv=/usr/local/mailman/postfix-to-mailman.py ${nexthop} ${user}
7. postmap /usr/local/etc/postfix/transport
8. postfix reload

9. created the vhosts in apache - everything works fine now

10.
Code:
#cd /usr/local/mailman
#bin/mmsitepass
New site password: mailman_password
Again to confirm password: mailman_password
11.
Code:
#bin/newlist
Enter the name of the list: mailman
Enter the email of the person running the list: admin@mydomain.net
Initial mailman password: list_password
12. echo "add_virtualhost('lists.mydomain.net','lists.mydom ain.net')" >> /usr/local/mailman/Mailman/mm_cfg.py

13. /usr/local/etc/rc.d/mailman start

14.
Code:
#cd /usr/local/mailman
#bin/genaliases
15. this is what i've added to /etc/aliases and then ran newaliases
Code:
## test mailing list
test:              "|/usr/local/mailman/mail/mailman post test"
test-admin:        "|/usr/local/mailman/mail/mailman admin test"
test-bounces:      "|/usr/local/mailman/mail/mailman bounces test"
test-confirm:      "|/usr/local/mailman/mail/mailman confirm test"
test-join:         "|/usr/local/mailman/mail/mailman join test"
test-leave:        "|/usr/local/mailman/mail/mailman leave test"
test-owner:        "|/usr/local/mailman/mail/mailman owner test"
test-request:      "|/usr/local/mailman/mail/mailman request test"
test-subscribe:    "|/usr/local/mailman/mail/mailman subscribe test"
test-unsubscribe:  "|/usr/local/mailman/mail/mailman unsubscribe test"

## mailman mailing list
mailman:              "|/usr/local/mailman/mail/mailman post mailman"
mailman-admin:        "|/usr/local/mailman/mail/mailman admin mailman"
mailman-bounces:      "|/usr/local/mailman/mail/mailman bounces mailman"
mailman-confirm:      "|/usr/local/mailman/mail/mailman confirm mailman"
mailman-join:         "|/usr/local/mailman/mail/mailman join mailman"
mailman-leave:        "|/usr/local/mailman/mail/mailman leave mailman"
mailman-owner:        "|/usr/local/mailman/mail/mailman owner mailman"
mailman-request:      "|/usr/local/mailman/mail/mailman request mailman"
mailman-subscribe:    "|/usr/local/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe:  "|/usr/local/mailman/mail/mailman unsubscribe mailman"
16. this is what i've added to /usr/local/etc/postfix/relay_recipients
Code:
test@lists.mydomain.net OK
test-admin@lists.mydomain.net OK
test-bounces@lists.mydomain.net OK
test-confirm@lists.mydomain.net OK
test-join@lists.mydomain.net OK
test-leave@lists.mydomain.net OK
test-owner@lists.mydomain.net OK
test-request@lists.mydomain.net OK
test-subscribe@lists.mydomain.net OK
test-unsubscribe@lists.mydomain.net OK
mailman@lists.mydomain.net OK
mailman-admin@lists.mydomain.net OK
mailman-bounces@lists.mydomain.net OK
mailman-confirm@lists.mydomain.net OK
mailman-join@lists.mydomain.net OK
mailman-leave@lists.mydomain.net OK
mailman-owner@lists.mydomain.net OK
mailman-request@lists.mydomain.net OK
mailman-subscribe@lists.mydomain.net OK
mailman-unsubscribe@lists.mydomain.net O
17. postmap /usr/local/etc/postfix/relay_recipients
18. edited /usr/local/etc/postfix/main.cf
Code:
relay_recipient_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf, hash:/usr/local/etc/postfix/relay_recipients
19. postfix reload

20. I have these lines in my /etc/pf.conf file on the gateway
Code:
# --- services running on the webserver ---
WEB_SERVICES = "{ 25 80 110 143 443 465 993 995 }

# --- redirect web traffic (http, https, mail, etc.) to the internal web server ---
rdr on $ext_if proto { tcp udp } from any to $ext_if port $WEB_SERVICES -> $webserver

# --- pass incoming web traffic (http, https, mail, etc.) ---
pass in quick on $ext_if inet proto { tcp udp } from any to $webserver port $WEB_SERVICES keep state
Now everything works fine.. from the internal network only. When I send a mail to the test@lists.mydomain.net the message is distributed to the subscribers successfully.

But when I send a message from the outside (gmail, yahoo, etc.) to test@lists.mydomain.net - the message is never to be delivered.

I think I'm missing something in my config. I checked it, double checked and found nothing wrong with

PS.: Sorry for the long post.
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
Old 16th February 2009
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Got it!

There were some thing that I had to add to my config files.

I've must have not seen this when mailman was installed, but all the necessary steps are described in /usr/local/share/doc/mailman/mailman-install.txt
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 5.2.6 and Apache 1.3 dialeight OpenBSD Packages and Ports 1 15th June 2009 03:04 AM
Upgrade Apache 1.3 mod_ssl to Apache 2.2 beandip FreeBSD Ports and Packages 11 26th March 2009 09:12 PM
apache error .. vhosts and access edhunter FreeBSD General 21 19th July 2008 10:24 PM
Apache 1.3 vs. 2.2 windependence FreeBSD General 4 16th June 2008 10:10 PM
Apache SSL mike171562 FreeBSD General 0 5th May 2008 09:41 PM


All times are GMT. The time now is 11:58 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick