QuicksearchArchivesCalendar
|
Monday, January 11. 2010Creating new Mailman lists on cPanel from the command lineTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Joshua,
When I try to use this approach, I get this error message: HTTP request sent, awaiting response... 401 Access Denied Unknown authentication scheme. Authorization failed. What did I do wrong? Thanks. Jim
What OS is your cPanel host running? Initial googling sugguests it's an issue with NTLM authentication, but as far as I know, cPanel doesn't run on Windows.
This post: http://www.unix.com/unix-linux-applications/139424-problems-wget-https-connection.html suggested adding --server-response to the wget call to see what is being returned by the server. Another possibility: does your cPanel host use HTTP Auth (i.e. does your browser pop up a dialog asking for a password) or do you get presented with a web form to log in? I would assume it uses HTTP Auth since you are getting a 401 response, but I thought I'd ask. Another post I saw also said the user's ISP configured the server to block wget requests (probably so it wouldn't be abused). You might to check with your hosting provider as well. Please let me know what you find. I'd like to hear the solution you find as well!
Joshua,
Thank you for the quick response. My OS is Centos 5.6 64-bit This is my server, so I am the ISP. The default login looks like a web page. How do I tell if it is using HTTP authentication or not? Here is the new response after I added --server-response: HTTP request sent, awaiting response... HTTP/1.1 401 Access Denied Connection: close Set-Cookie: logintheme=cpanel; path=/; HttpOnly; secure; port=2083 Set-Cookie: cprelogin=no; path=/; HttpOnly; secure; port=2083 Set-Cookie: cpsession=pQy0XMRBngmnIvZ_YBtea1tEDqyYMVJ7gK3fa4YZo4vH8vUyQDTnVQvF832nwT4w; path=/; HttpOnly; secure; port=2083 Server: cpsrvd/11.28.87 Content-type: text/html Unknown authentication scheme. Authorization failed. Jim
The '401 Access Denied' should indicate it's using HTTP Auth.
Hmm, I notice my server is sending back this header: WWW-Authenticate: Basic realm="cPanel" and your server is not, which would explain the error message. Aha! I think I found it. Login to your main WHM site, and go to Tweak Settings (in the Server Configuration group). In the security section, there is a setting: "Enable HTTP Authentication" Click "On," as it would appear the default is "Off." Save, and then try again. Let me know if that works!
Joshua,
I found the missing information at: http://www.cpanel.net/blog/integration/2009/08/using-whm-remote-authentication.html After following those instuctions, I get this response: HTTP request sent, awaiting response... HTTP/1.1 403 Forbidden Connection: close Server: cpsrvd/11.28.87 Content-type: text/plain 2011-06-01 01:36:24 ERROR 403: Forbidden. I tried creating a list manually using my Master CPanel username and password. The web page does not allow the domain name for any of my sites, only for the server name. Do I have to use the username and password of the site where the mailing list will be created? I'm new to CPanel, so I don't know how to bypass the site password requirement. I don't know the passwords for each site. Thanks. Jim
The WHM auth information you found may allow you to bypass the password restriction, but yes, the technique I outlined requires the password for the host on which you want to create the list, since lists are a "host level" function of cPanel.
So, if you want to create a list of mylist@lists.example.com, you would have to pass the parameter domain=lists.example.com AND make the call to: https://example.com:2083/frontend/x3/mail/doaddlist.html AND use the user name and password for the 'example.com' account on your cPanel installation.
Joshua,
I can login manually to https://example.com:2083 by using the site username and the Master Server Password. This gives me access to the site mailing lists. However, I still get the same error with wget. wget --no-check-certificate --server-response --header='Authorization: WHM cpanel:$hash' --post-data "email=$listname&domain=$domainname&password=$password&password2=$password" https://www.$domainname:2083/frontend/x3/mail/doaddlist.html --2011-06-01 08:01:15-- https://www.xxxxx.org:2083/frontend/x3/mail/doaddlist.html Resolving www.xxxxx.org... xx.xx.xxx.xxx Connecting to www.xxxxx.org|xx.xx.xxx.xxx|:2083... connected. WARNING: cannot verify www.xxxxx.org's certificate, issued by `/C=US/ST=Unknown/L=Unknown/O=Unknown/OU=Unknown/CN=xxxxx/emailAddress=ssl@xxxxx': Self-signed certificate encountered. WARNING: certificate common name `xxxxx' doesn't match requested host name `www.xxxxx.org'. HTTP request sent, awaiting response... HTTP/1.1 403 Forbidden Connection: close Server: cpsrvd/11.30.0.23 Content-type: text/plain 2011-06-01 08:01:15 ERROR 403: Forbidden. Any ideas? Jim
My understanding is that you have to set up the hash via the cPanel control panel, and then the $user portion needs to be the user of the domain you are editing. Is 'cpanel' the user name of the domain to which you are trying to add the list?
I've never gotten in to a domain account via the "site username" and "master server password," so that approach is foreign to me. All I know is that using the username and password associated with the domain name is what worked for me. I'm sorry I can't be of any more help!
Joshua,
Do you think that I should change the server settings? One of them is "Enable HTTP Authentication" which is off. Jim
Yes, enable that. See my reply to your second comment above where I talk about enabling that setting.
With HTTP auth enabled, you should be able to use the method outlined in this post. |
self.about()My name is Joshua Kugler, and I'm a programmer/developer and a system admin. On this here blog, I pontificate about all things related to code, work, projects, and sometimes just life. Look around, snag my RSS feed, and drop me a line, if you wish. All opinions are mine, and not necessarily those of my employer.
self.links()CategoriesCopyright |
|||||||||||||||||||||||||||||||||||||||||||||||||