# courier webadmin setup

## rtwick

Hi all,

just trying to buildup a box with gentoo. I have installed the courier mta package and i would like ot use the webadmin feature of courier but can not figure out anyway how to setup the webadmin passwd. 

earlier I used to compile courier from scratch but there was a make web-admin-password or something like that which was creating the password but now I can not find that rule in the source tarball.

any idea?

R'twick

----------

## btg308

Found it in the main Courier Makefile.in in the 0.39.3 tarball (not the one in the webadmin subdir, mind you)

```

install-webadmin-password:

        @stty -echo ; echo -n "Password: " ; read P; stty echo ; echo "" ; echo $$P >@sysconfdir@/webadmin/password && chown @mailuser@ @sysconfdir@/webadmin/password && chgrp @mailgroup@ @sysconfdir@/webadmin/password && chmod 400 @sysconfdir@/webadmin/password

```

So just do that stuff manually and you should be fine. ;-)

(Hint: @sysconfdir is /etc/courier in Gentoo, NOT /usr/lib/courier like Courier's installation docs says)

----------

## mooman

I dunno if the original poster ran into this, but I found lots of posts around the net about people who couldn't get the webadmin password to work, and no answers!  So after extensive trial and error and some perl hacking, i solved it (at least for me) and wanted to document the results in case anyone else had problems:

As the original poster points out, the courier instructions want you to execute a make command to create the password, something that isn't an option for us emergers.

The password.dist file gives you most of the steps you need to manually create that file:

 *Quote:*   

> 
> 
> # 1. Open /etc/courier/webadmin/password for editing
> 
> # 2. There should be one word in this file.  The webadmin password
> ...

 

But that wasn't enough to get it to work for me.

1. Make sure the webadmin cgi is somewhere that apache can run it

2. Make sure the /etc/courier/webadmin directory has all the execute permissions set:  chmod 755 /etc/courier/webadmin

3.  I couldn't get the password file to get read until I did chown apache:apache password

Maybe that last step is because something else isn't configured right, but I couldn't find it.  It took almost a day and a half of poking through perl scripts and adding debugging to get the workaround figured out...  Hopefully it helps someone out!

Words to seed search engine: courier webadmin courierwebadmin invalid password

----------

## Scytale

 *Quote:*   

> Maybe that last step is because something else isn't configured right, but I couldn't find it.

 

Did you check the owner and modes for the webadmin CGI file? They need to be like this:

```
-r-sr-xr-x    1 root     bin          3396 May  2 00:12 webadmin
```

chown'ing the password file to apache:apache is a workaround to make webadmin able to read it, but as soon as the webadmin script tries to read or modify any Courier config file it has no access to it. At least this was the case at my box.

----------

## hachre

i still don't get this running...

the earlier posts helped but everytime i press save in the webadmin menu it can't access the files to write them  :Sad: 

----------

## jkliff

Hi,

Altough this thread seems a little old, I'm having the exact same problema on a 0.43.1 Courier install. I saw rtwicks thread on courier-users, but that didn't seem to clarify the problem to me.

Any of you have had any success with this subject?

Any halp is appreciated. 

Thanks

----------

## hachre

i'm still unable to use the web mail feature...

im using squirrelmail instead..

----------

## jkliff

I sort of managed to have webadmin running (working on webmail right now -- although I consider squirrelmail for webmail), as I *really* needed it for configuration right now. Anyway, I only got it working without ssl support. I'll be working on this as soon as possible.

After all, it seems to be pretty straight forward:

1. Copy /usr/lib/courier/courier/webmail/webadmin to /home/httpd/cgi-bin/, preserving the attributes 

```
cp -p
```

2. Do as told in /etc/courier/webadmin/password.dist

3. Create the unsecureok file 

```
touch /etc/courier/webadmin/unsecureok
```

Then, just browse to http://server/cgi-bin/webadmin.

Hope this has been of some help. I'll keep posting my advances.

----------

## meulie

Hmm, I get the following if I do this: 

```
[Tue May 11 18:57:19 2004] [error] [client 192.168.2.24] attempt to invoke directory as script: /var/www/localhost/cgi-bin/courierwebadmin/
```

Any suggestions anyone?

----------

## henniez-swisswater

hi there

here is what i did.

1) cp -p  /usr/lib/courier/courier/webmail/webadmin /var/www/localhost/cgi-bin/

2) I configuered apache to use ssl (used the postfix howto http://www.gentoo.org/doc/en/virt-mail-howto.xml)

3) changed the /etc/courier/webadmin/password file 

4) chown mail:mail /etc/courier/webadmin/password

5) chmod 400 /etc/courier/webadmin/password

and that's it

hope it will work for you as well

----------

