|
FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD. |
|
Thread Tools | Display Modes |
|
|||
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 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> 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 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 |
|
|||
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> 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 |
|
|||
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 |
|
|||
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. |
|
||||
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/ 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. |
|
|||
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 |
|
|||
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 |
|
|||
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. 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 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} 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 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 13. /usr/local/etc/rc.d/mailman start 14. Code:
#cd /usr/local/mailman #bin/genaliases 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" 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 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 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 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 |
|
|||
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 |
Thread Tools | |
Display Modes | |
|
|
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 |