Plesk 12.x / Linux :: How CLI DNS Command With Wildcard
May 3, 2015
I want to run a script that will loop through all of the domains on a particular server and remove all MX records with mail.*.I am testing on a single test domain at the moment but I'm not sure how to do the wildcard./usr/local/psa/bin/dns -d example.com -mx '' -mailexchanger mail.*
The following example command is from: URL....To add an MX resource record mail3.example.com specifying domain name mail.example.com as the mail exchanger for the record, and setting the mail exchanger's priority to the DNS zone on the domain example.com to 15:
# ./dns -a example.com -mx mail3 -mailexchanger mail.example.com -priority 15..What does the mail3.example.com got to do with it? Isn't it just adding a MX record mail.example.com?
I have a problem with Nginx on myPlesk 12 with wildcard dns.I want subdomains URl to be like root domain url. Exemple. URL...You can see a live exemple here: URL.... give error 404 instead of showing root domain file (URL....). It's the same for images.What specific rule I must add in plesk panel?
I have a new Plesk 12 installation. I have configured a domain (example.com) with hosting that also requires wildcard subdomains.
To achieve this I had to create a vhost.conf file with...
ServerAlias *.example.com
This works and I can go to http://anything.example.com with no issue.
I purchased a wildcard SSL certificate for *.example.com and successfully installed it.
If I go to https://example.com it works perfectly and shows the correct certificate, however if I go to https://anything.example.com it tells me the connection is untrusted, when I view the certificate, it shows the Parallels Plesk self certified certificate and not my purchased certificate.
I created a vhost_ssl.conf with
ServerAlias *.example.com ServerAlias *.example.com:443 #tried with and without this line
If I add an exception in the browser, then I am taken to the correct place, albeit with the incorrect certificate.
Of course I have executed httpdmng --reconfigure-domain example.com and also tried a full reboot.
In summary:
http://example.com - works
http://anything.example.com - works
https://example.com works with my certificate
https://anything.example.com has Parallels certificate but routes to correct page
I have several domains configured in my Plesk, and one of them is set as the "Detault site" under Home >> Tools & Setings > IP address management.This has the unpleasant side effect that any domain I point to this IP renders content from the Default site unless it's setup. How can I configure the default site to render content from only one domain?
I am running a CentOS 6.5, 64-bit server with Plesk 12.0.18, and need to install a wildcard SSL for one of the domains/sub domains hosted on this server.
So you have the csr and private key installed (and domain.crt?), you just need to open..
i have to delete all PTR records in over 80 domains in a Plesk 12 panel, when i tried to run the dns command to remove the PTR record from a domain, i got the error :
Code: Unable del record in DNS server: unable find DNS record ...
There is a KB article about this specific problem : [URL] .... , but it refers to older Plesk versions (8.x-10.x). I gave it a shot by copying the fix file from all 3 different versions to /usr/local/psa/admin/plib/api-common/ and i got the following PHP errors:
Code:
PHP Warning: include_once(class.PHostingManager.php): failed to open stream: No such file or directory; File: /usr/local/psa/admin/plib/api-common/cuDns.php, Line: 4 PHP Warning: include_once(): Failed opening 'class.PHostingManager.php' for inclusion (include_path='/usr/local/psa/admin/plib:/usr/local/psa/admin/externals'); File: /usr/local/psa/admin/plib/api-common/cuDns.php, Line: 4
[URL] ......
Is there any workaround this PTR issue? Also, is Parallels going to update the article and provide solution for Plesk 12?
Up till the last update Plesk was working correctly. After the latest update I can't send out mail in any form:
webmail, pop3, wordpress forms, etc.
This is the error message I get:
Command died with status 100: "/usr/bin/spamc". Command output: Mail handler 'limit-out' said: REPLY:554:5.7.0 Your message could not be sent. The user spamfilter is not allowed to send email.
When I reverted back to the last snapshot before the update everything works fine again. But the automated update bot messes it all up again when it downloads the newer version.
I just upgraded my Plesk 11.5 on Plesk version: 12.0.18 Update #9 , and after the upgrade the Postfix stop working. And forwarding, receiving is not working at all and I am getting message bellow.
I'm using this script as a cron to generate DKIM keys for the domains I have. It's an easy script. And it does it's job just OK. I have the necessary software installed and configured.
The way it works is:
The script check if the domain in queue has a record for it. If it doesn't, OpenDKIM generates a one time DKIM record for mail._domainkey that I am entering to my dns records for all the domains I have.
After creating the DKIM record, it checks and deletes mail._domainkey records if there's any. Then adds the generated DKIM to plesk dns zones and disables/enables greylisting to create the appropriate dns entry.
If it does have a DKIM recors on the hdd already, then it removes
mail._domainkeyand TXT o=-entries.
After that it basically adds the already generated DKIM record and it disables/enables the greylisting for each domain in order to recreate "TXT o=-"
Up till here, it works fine. I can see these entries when I check the DNS Settings. They are there.
But whenever I run this script either via cron or manually, I get an error message on my panel: (You can check the screenshot as well)
Code:
Warning: The DNS zone was modified. If you would like to apply DNS template changes to this zone, either click the 'Apply DNS Template Changes' button on this page or choose the 'Apply the changes to all zones' option in Server Administration Panel > Tools & Settings > DNS Template Settings > Apply DNS Template Changes.
And unless I manually click "Apply DNS Template Changes" for EVERY SITE it doesn't go away.
So, I was wondering, is there a way to scriptize that command? Or how to prevent it?
This is the command I use to generate DKIM and add it to Plesk database, also if any such record exists, delete and re-write it:
Is there a command line way of removing Plesk backups?
I'm looking for the command line equivalent of these steps: Log into Plesk as the server admin > "Tools & Settings" > "Tools & Resources" > "Backup Manager" > check a backup and click "Remove".
We have a script that copies the contents of "/var/lib/psa/dumps/" to Amazon S3 for long-term storage of backups. It runs nightly after a scheduled Plesk backup. Once that script completes successfully, we'd like to delete the Plesk backup to free up disk space. We have Plesk's "Maximum number of backups in the repository" set to 1.
But Plesk appears to keep that backup around while creating a new backup (which makes some sense). This is causing us trouble because the server does not have enough disk space for two backups. As a temporary solution, I'm manually deleting the backup each day through the Plesk admin, but would like to automate it if possible. If automation is overly complex/risky, we'll look at upping our disk space instead.
Details: Doing restart of Parallels Installer... File downloading products.inf3: 100% was finished. File downloading plesk.inf3: 10%..20%..30%..40%..50%..60%..70%..80%..90%..100% was finished. File downloading ppsmbe.inf3: 17%..26%..37%..47%..57%..78%..88%..100% was finished. File downloading sitebuilder.inf3: 22%..35%..48%..60%..73%..86%..100% was finished.
[code]....
ERROR: Currently installed version of product with ID 'plesk' is not available from download site anymore.Please upgrade to the next available product version to receive software updates.Seems like the RPM got damaged, but I already fixed that part, now when I put "install" I'm geting the following Installation started in background..Getting bootstrapper packages to installation list:
Following bootstrapper packages will be installed: (empty) ---------------- Getting packages to installation list: Following packages will be installed: (empty) ---------------- Loaded plugins: fastestmirror
Patch for plesk 12.0.18 will not be installed since it is already applied.Error: You already have the latest version of product(s) and all selected components installed. Installation will not continue.HOWEVER the "mail" and mail server configuration no longer shows in "tools & settings".
We have a plesk server running on a Ubuntu 14.04.2 LTS machine. We check the state of the mailqueue with nagios, executing the "mailq" command. After the AutoInstaller upgraded our installation from 12.0.18 update 38 to 39, we noticed, that the nagios check failed.
After investigating a little bit, it seems that we found the problem:
When I enter "mailq" in the shell, the command is executed and gives me an proper output. But when I try to execute the command with its full path "/usr/bin/mailq" nothing happens, and I have to cancel with [ctrl]+[c]. The which-command delivers exactly the same path as written above...
I have a subscription and I'm able to switch the subscription to a given service-plan, but I'm unable to sync the subscription with the plan, using the CLI. These are my commands:
result => The subscription <domain.com> is now associated with the service plan Hosting..When watching the webinterface in Plesk, I see the domain is "connected" to the service plan, so far so good. However, I notice that the subscription is not synced.
Back to the CLI, I've tried some combinations, but I can't get the subscription synced. The webbased interface keeps telling me that the subscription is unsynced. Here is what I've tried:
And I also unlocked it (just in case it was locked) like so: /usr/local/psa/bin/subscription --unlock-subscription <domain.com>
The funny part is that the CLI tells me: "Subscription <domain.com> was synchronized with the associated service plans." but unfortenately it's not if I look through the GUI. Only if I click the sync-option webbased the subscription get synced. we have to transfer over 1000 domains and need to sync these domains with a given service-plan.
I'm attempting to utilize the WordPress Toolkit. After clicking scan on a webspace with WordPress installed the panel returns the error "'plugin list' is not a registered wp command. See 'wp support'.".
I've tried it on a few servers that has the WordPress Toolkit installed, but they all return the same error.
We're trying to migrate a Webspace from a 11.5 to a 12.0.18 Plesk host using the Migration Manager. The Webspace contains 4 domains. The main domain of the webspace gets migrated fine, however, all of the "child" domains fail with the following error:
Stderr is Wrong syntax for command's '-webspace-name' parameter. 'webspace-domain.ch' does not match the pattern '/^[[:alnum:]]([[:alnum:]-]{0,61}[[:alnum:]]){0,1}(.[[:alnum:]]([[:alnum:]-]{0,61}[[:alnum:]]){0,1})+$/iu'.
Although running >> /usr/local/psa/bin/dns --info dev.sname.c002.aname.domain.com >> shows the 'ecz1' TXT record exists for "dev.sname.c002.aname.domain.com" : ... ecz1.dev.sname.c002.aname.domain.com. TXT ecz1
[Code] ....
The issue can be caused by extra spaces in the TXT record:
Code: [root@a10-52-143-28 ~]# /usr/local/psa/bin/dns --add dev.sname.c002.aname.domain.com -txt 'ecz1 ' -domain ecz1 SUCCESS: Creation of DNS record in Domain 'dev.sname.c002.aname.domain.com' complete. [root@a10-52-143-28 ~]# /usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt 'ecz1' -domain ecz1 Unable to del record in DNS server: unable to find DNS record
In the following example I have 3 such TXT records with 3, 5, 7 extra spaces and remove record with 3 spaces:
Code: [root@a10-52-143-28 ~]# mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "select host, val, (length(val) - length(rtrim(val))) as extraspaces from dns_recs where host='ecz1.dev.sname.c002.aname.domain.com.' and val like 'ecz1%'" +---------------------------------------+-------------+-------------+ | host | val | extraspaces | +---------------------------------------+-------------+-------------+ | ecz1.dev.sname.c002.aname.domain.com. | ecz1 | 5 | | ecz1.dev.sname.c002.aname.domain.com. | ecz1 | 3 |
We found an issue after running plesk mchk command to restore all the mail server settings with SpamAssiassin settings enabled for all email accounts on the Plesk Server.
After running the mchk command, we found many warning messages in the psa maillog as following "authpsa : No such user [Email account] in mail authorization database".
We checked the mysql database for records on the Email Account that the error is referring to but found that the Domain Email Database was deleted (email address, password, email data). Is this something normal that the plesk mchk command does? Plesk 12.0.18 Update #37
What is Linux command for compressing all the files under a Directory, as well as all the files in sub-directories under that directory, so that upon uncompression the files are created in the right directory and sub-directory.
Also of course what is the command to un-compress this compressed file?
In case: the Linux OS here is Redhat Enterprise and the web server is Apache.
how I might be able to execute a Linux command by sending a text message to some email address? Where if that email address gets a message (either any message, or perhaps only messages containing some password), a Linux command is executed, e.g.
I am wondering is there any software could offer auto complete feature for linux command? most linux need enter lots of parameters, if there is such a tool, that could be cool & great.