Posts Tagged ‘lt’
Monday, October 24th, 2011 I needed to link a new created WordPress Post to external web page address. So when one clicks over the created post he opens an external website.
I’ve googled around to see how this can be achieved and found ordpress external links plugin
I gave a go of the plugin, but pitily I couldn’t make it work. I decided to try some other methods and after some time I tried another approach. I used the HTML >a href=””< My Post Title </a> as a title and it appeared this simple method prooved working 😉
Here is a small screenshot, from wordpress Add New Post dialog
By the way the information online I’ve found on how this the external link creation for a Page or a Post is made was quite obscure and messy. i wonder why there is no clear explanation on the direct a href link creation, especially since WordPress is a de-facto standard for a blogging platform and nowdays powers up so many websites engines around the world.
Tags: creation, de facto standard, dialog, external url, external web, href, href link, HTML, information, link, link creation, lt, nowdays, online, page, platform, plugin, post, quot, screenshot, standard, time, url, way, web page address, Wonder, Wordpress, working
Posted in Linux, Various, Web and CMS, Wordpress | 3 Comments »
Friday, July 1st, 2011 The Return Path variable on one of the qmail mail servers I manage was improperly set.
New newsletter mails initiated by the php scripts on the mail server had the improper return path set in the mail headers, like so:
Return-Path: <anonymous@mail.mymailserver.com>
Therefore many mail servers dropped messages as the set Return Path variable in the headers was incorrectly set to the domain mail.mymailserver.com
Thus to change the Return Path to the correct one that should have been mymailserver.com I had to include mymailserver.com in qmail’s control file /var/qmail/control/bouncehost, e.g.
root@qmail:~# echo 'mymailserver.com' > /var/qmail/control/bouncehost
root@qmail:~# echo 'mymailserver.com' > /var/qmail/control/doublebouncehost
By the way the return path in qmail is set by:
> qmail-inject and qmail-send
There seems to be also some way to ovewrite the default set return-path variable with some php variables but I have never tried this one.
Cheers 😉
Tags: anonymous mail, Auto, bouncehost, Cheers, com, control, default, domain, domain mail, doublebouncehost, Draft, file, lt, mail, mail headers, mail server, mail servers, mymailserver, newsletter, ovewrite, Path, php, php scripts, php variables, Qmail, Return, return path, root, server, var, way
Posted in Linux, Qmail, System Administration | 2 Comments »
Sunday, April 11th, 2010 I have a running awstats installation and needed a way to protect the cgi-bin statistics with a password. Thanksfully there is a way to achieve that through the Apache. To secure your let’s say awstats.pl or any other /cgi-bin/ executable with a password here is what you need to do:
First make sure you have:
Allowoverride All directive enabled in your Apache Directory permissions for the /cgi-bin/.
Next you will need to create an .htaccess file in your /cgi-bin/ directory .The file should contain something close to:
<FilesMatch "awstats.pl">AuthName "Login Required"
AuthType Basic
AuthUserFile /var/www/awstats/.htpasswd
require valid-user
</FilesMatch>
The above example presumes that you have created the .htpasswd in /var/www/awstats/.
To create this file issue the command:
debian:~# htpasswd -c /var/www/awstats/.htpasswd admin
That’s all now your awstats installation or any other executable specified in FileMatch would be created with a password.
Tags: Allowoverride, apache, AuthType, AuthUserFile, awstats, cgi bin directory, command, directive, directory permissions, file, htaccess file, htpasswd, installation, issue, login, lt, password, Password Protecting single file with htaccess password / Securing single exetubale in Apache with password through htaccess, pl, Protecting, quot, Securing, single file, something, statistics, Thanksfully, var, way, www
Posted in Linux, System Administration, Web and CMS | No Comments »
Friday, October 21st, 2011 I needed to convert a file which had a Bulgarian text written in UTF-8 encoding to Windows CP1251 in order to fix a website encoding problems after a move of the website from one physical server to another.
I tried first with enca – ( detects and convert encoding of text files from one encoding to another).
The exact way I tried to convert was:
linux:~# enca -L bg /home/site/www/includes/utf8_encoded_file.php
...
Unfortunately this attempt to conver was unsucesfully, and the second logical guess was to use iconv – Convert encoding of given files from one encoding to another to do the utf8 to cp1251 conversion.
I reached for some help in irc.freenode.net, #varnalab channel and Alex Kuklin helped me, giving me an example command line to do the conversion.
iconv winedows to cp1251 conversion line, he pointed to me was:
linux:~# iconv -f utf8 -t cp1251 < in > out
Further on I adapted Alex’s example to convert my utf8_encoded_file.php encoded Bulgarian characted to CP1251 and used the following commands to convert and create backups of my original UTF8 file:
linux:~# cd /home/site/www/includes
linux:/home/site/www/includes# iconv -f utf8 -t cp1251 < utf8_encoded_file.php in > utf8_encoded_file.php.cp1251
linux:/home/site/www/includes# mv utf8_encoded_file.php utf8_encoded_file.php.bak
linux:/home/site/www/includes# mv utf8_encoded_file.php.cp1251 utf8_encoded_file.php
Tags: alex, attempt, bg, bulgarian text, cd home, command, conver, conversion, Convert, enca, file, file linux, freenode, gnu linux, guess, help, home, iconv, includeslinux, line, Linux, lt, move, mv, order, outFurther, php, physical server, UTF, varnalab, way, www
Posted in Linux, System Administration, Various, Web and CMS | No Comments »
Sunday, September 25th, 2011 I’ve had two domain names which were pointing to the same website content.
As one can read in any SEO guide around this is a really bad practice as search engines things automatically there is a duplicate site content and this has automatically a negative effect on the site pagerank.
To deal with situation where multiple domains are pointing to the same websites its suggested by many SEO specialists that a 301 redirect is created from all the domain websites to a single website domain which will open the actual website.
Making the 301 direct domain from the sample domain my-redirect-domain.com to www.mydomain.com can be done with a virtualhost dfefinition in either httpd.conf or with the respective file containing the domain virtualhost definitions:
Here is the exact VirtualHost code I use to make a 301 redirect.
<VirtualHost *>
ServerAdmin support@mydomain.com ServerName my-redirected-domain.com
ServerAlias my-redirected-domain.com www.my-redirected-domain.com
RewriteEngine on RewriteRule ^/(.*) http://www.mydomain.com/$1 [L,R=301]
</VirtualHost>
After placing the VirtualHost redirect, an apache redirect is required.
Further on when a Gooogle or Yahoo Bot visits the website and does any request to my-redirect-domain.com or www.my-redirect-domain.com , they will be redirected with a 301 reuturned code to www.mydomain.com
This kind of redirect however can have a negative impact on the Apache CPU use (performance), especially if the my-redirect-domain.com is high traffic domain. This is because the redirect is done with mod_rewrite.
Therefore it might be better on high traffic domains to create the mod_rewrite redirect by using a vhost like:
<VirtualHost *>
ServerAdmin support@mydomain.com
ServerName my-redirected-domain.com
Redirect 301 / http://www.mydomain.com/
</VirtualHost>
The downside of using the Apache 301 redirect capabilities like in the above example is that any passed domain urls like let’s say http://www.my-redirected-domain.com/support/ would not be 301 redirected to http://www.mydomain.com/support/ but instead the redirect will be done straight to http://www.mydomain.com/
Tags: apache, capabilities, com, conf, CPU, definitions, domain names, domain websites, downside, Gooogle, guide, httpd, impact, kind, lt, mydomain, nbsp, negative impact, pagerank, rewrite, RewriteEngine, RewriteRule, Search, search engines, seo specialists, ServerName, traffic domain, traffic domains, use, vhost, Virtualhost, website content, website domain, www, Yahoo
Posted in SEO, System Administration, Various, Web and CMS | 2 Comments »