Category Archives: linux
Hi,
today seeing the logs of one of the servers i see that all the emails sent by one of the scripts was flagged as BAD HEADER and put it on quarantine. was something weird why i constructed the header variable in the correct way, so i tried to search for a solution. first of all i set the directive @bypass_header_checks_maps
@bypass_header_checks_maps = (
read_hash(“/var/amavis/badheader_bypass”),
);
there you can set 1 per line, all the email that you want to avoid the email header check. even that i do it, it didn’t worked for me, so i looked at the quarantine email and i look something like this:
X-Amavis-Alert: BAD HEADER SECTION Improper use of control character (char 0D
hex): Content-type: text/html; charset=iso-8859-1\r
so, i erased all the /r from the emails headers and all worked
i hope this help you in some way
Regards,
Shadow.
Related Post
Hi,
in the process of the migration of the server have come the moment when my boss needed to checkout a copy of the repository. i have checked several times the subversion installation and i made like 3 checkouts before even start. my big mistake have do not made a complete checkout of the repository in a windows machine (and more specifically, a windows 7 machine), this have resulted in a very large session of debugging, so to avoid you hours of work, i’m here to give you the solution to the most normal problems.
1) Error: The file or directory is corrupted and unreadable.
as the subversion FAQ says, this could be for 2 reason, a antivirus program or the windows indexing service. this basically happen why the antivirus or the windows indexing service move the downloaded file, so subversion can’t find it. in the case of my boss, the only solution with the antivirus (kapersky) was to disable it. in case of the windows indexing service, is not enough to disable it completely, you need to follow this steps under the folder where you are making the checkout.
* Click the start menu button, then click in the text box to begin a search
* Type in “windows index”
* Click on “Indexing Options” that should come up in the search
* When the Indexing Options box comes up, Click on the Modify button. This will pop up an Indexed Locations dialog, where you should see a list of some “locations”, with your hard drive(s) being in the list.
* Expand the desired hard drive, down to the root folder of the files you’re using SVN with, and make sure the box is unchecked. Also note that the hard drive will most likely be collapsed, and will have its box unchecked, even though once you expand it, you may find checked boxes.
2) Error: The system cannot find the file specified.
this is usually why you have 2 files with the same name with the only difference is some letter in uppercase/lowercase. the problem is that windows have a case-insensitive file system, so for windows, those files are 1 and for subversion no. the only solution is to rename one of the files. for this, if you already have a checkout made in a linux box, you can delete and make a commit. if not, with tortoise SVN you can use the repo broswer to erase directly. after that, is probably you need to delete the folder and make a update again (and maybe a cleanup in the middle)
3) Error: REPORT of ‘/svn/!svn/vcc/default’: Could not read chunk size: connection was closed by the server
i don’t know why this happen, just trying a update have continue the checkout
4) Server sent unexpected return value (413 Request Entity Too Large) in response
the first error that need to be fixed on the server, only happened on the windows 7, dunno why. basically is a apache limit at the upload of XML info, to fix that, edit your httpd.conf (usually located on /etc/httpd/conf/httpd.conf) and add this line:
LimitXMLRequestBody 0
and of course restart httpd/apache
i hope this will help you in some way
Regards,
Shadow.
Related Post
Hi,
as you see from previous post, i’m working installing some servers, and even i have some experience doing server administration, i’m learning a lot in this few days.
i’m using linux every day for the past 4 years, and i’m really happy. i need to say that i always used distribution linked in some way with debian, as ubuntu, kubuntu, linux mint etc.
in terms of servers, i always used centos, fedora or red hat, why’s that? why they was already installed, was the only option available or if i can choose, why other more experienced devs told me that was the standard in the web industry. i always made some server administration but now that i’m really touching deep on it i’d say that i will never use a centos or red hat derivated OS again, and i will fundament this with facts and experiences from the few days.
the most biggest flaws i see on distribution as centos, is the package system, yum. i think is far to be enough capable as apt is for debian. why i say that? the search of the package is not complete as apt is, the erase of packages could bring serious problem if you don’t pay a lot of attention, i even erased yum itself erasing secondary packages O_O.
the other big problem are the repositories, and maybe this problem is only specifically for centos, but really lack of a lot essential packages, where you need to depend from third party repositories or compiling yourself. didn’t even enabling the centos plus and extra repositories you are able to get something up to date (and i’m talking about stable version released a long time ago)
if some server admin read this is surely thinking “this is a noob” and maybe is right, but measure the utility of something from the things i can get from it and in the time it takes me to do it and i assure you that all the stuff i made on centos i could made it in the half of the time for the availability of compiled packages in the repositories and the utility of apt. i know that the beautiful of linux is if you don’t find something for your OS, you can compile it with the source, but seriously, is not nice when you are working, waste hours debugging for dependencies and stuff when can be solved with a simple apt-get.
so, from me, i say bye bye centos, for now i will only use debian whenever i can, and i regret the decision to use you in this new servers.
Regards,
Shadow.
Related Post
Hi,
i’m still making server administration and a migration and i learned a few things that could help you at this matter
1) look for a tutorial that fit your needs
in my case i was needed to set up a mail server. the old server have used courier for imap and pop3 and exim for smtp. event that i tried to accomplish the same, some technical problems don’t let me to do it and i made several mistakes in the process. before you write any command on the console, make a deep research in what do you need and how you can accomplish it. in the net there are a lot of tutorial that will explain you step by step what is needed to do, just follow it and all will be fine
2) a postix with mysql is your best option
i need to say it, something that worried me was that maybe i will have performance problems using mysql with postfix and courier. really the server is do not have a high load in terms of mail but even if it have it, i will research to avoid it and still using mysql. the facility to make changes, as forwarders, accounts, and a lot of stuff worth any performance consumtion, more if you need to manage a lot of accounts.
3) if you have sendmail or exim, uninstall it before anything
postfix have their own sendmail command, so is a good action to uninstall any MTA that will not be used.
4) security and iptables
flush all iptables at the time of testing, so you don’t get anything blocked, and change the default port to others. when you finish, lock all the entrant and out traffic except the used port for your services. configure and use tls, even that is better that the user will be forced to use tls, maybe is a good option to leave both options enabled for the future.
5) commons errors
a list of commons errors you can find, usually you can get a very detailed log if you edit your master.cf and add a -v at the inet smtpd directive
/home/vmail/user is not found : that means that the directory where the user emails should be stored is empty, check it and create the correct directorie(s) (depend if you are using maildir and mailbox
invalid command : this is a esoteric error and depends a lot of the context it appear, is why the server don’t recognize the client command. could be a client error or a server misconfiguration (usually is problem of the server if you are using a popular client as thunderbird)
configure postfix to use it by PHP in the mail () function : this is something cost me to figure out, as screw up installing first postfix, and later exim and get replaced the sendmail command. for this, you should have correctly installed and configured postfix, and have the sendmail command available (if you get a command not found error, backup the config files and re-install it). to configure the php to use postfix, just edit your php.ini and set the sendmail_path = sendmail -t -i (like this, as is, whiteout a full path)
fail user authentication: if you set the -v flag, you should easily see where is the error, could be that the query’s set for postfix sasl are wrong, or the mysql user used to connect to the database is wrong, or the user data in the DB is wrong. remember that the password of the user should be encrypted, you can use the mysql function ENCRYPT for that (using phpmyadmin is very easy)
i hope this help you and save you some time in this matter
Related Post
Hi,
i really like the small distributions of linux, i think they can offer a lot of useful features for that admin or power user in a fast way and consuming a lot of little resources.
this time i going to write a review of this distribution called Tiny Core. the iso only weight 10 MB and is focused to bring the most basic graphic environment. and when i say basic, i mean really basic, the desktop don’t have anything more that the essential tools to mount drives, make USB installation, and make basic administration tasks. anyway as any linux have a terminal where you can make most of the things.
i wasn’t able to test it as i tested it on a virtual machine but the hardware support is poor as the intention is to offer the most basic installation possible. anyway it brings a GUI package manager where you have available the most common apps and libraries.
there is anything else to say really, is a distribution for experienced users that could be a base for any interesting project as a base, with enough time to find , install, customize and compile any driver or software needed. also could be good as a rescue distribution for an old USB or disk, as it boots really fast (less than 2 seconds). anyway in this matter i will choose better a more hardware compatible distribution.
Related Post
Hi,
some weeks ago someone told me that ngnix was better than apache as can handle more users and was more stable with big traffic. as i usually don’t discard the opinions and recommendations i receive, i started researching about this as i didn’t know anything about ngnix. for that, i wanted to write this post so can save you some time looking at the internet
. for my research i used sources as serverFault.com and other blog post where it benchmark different php scripts (custom and wordpress blogs).
Apache and ngnix, what is the diference?
the main difference between ngnix and apache is that the way both web servers handle the user requests. apache have a multi thread architecture and ngnix have a unique thread architecture to process the user request. this is the main difference between both, the other important difference are the config files and the rewrite rules, where the format is difference from apache and a new user need to learn this new way to format the htaccess and the config files. other than this, both can manage virtual hosts, aliases, etc..
Define the goal or purpose to choose.
i always say that there is no a complete tool or a ultimate language and technologies, each decision of what tool to use depends of the requirements of the project. in this case is the same, you need to evaluate your project to decide what to use.
after my research i found that ngnix have a greater performance, in terms of memory needed, when the ngnix is serving static content. static content is called all what are images, videos, flash, files etc.. and optimized and cached dynamic pages, like a wordpress blog with super cache plugin.
in term of speed both are almost equal, having a difference in favor to ngnix at serving static files.
Conclusion
when i started to research this, i have in mind 2 projects, one of them was a non-optimized sites and the other a highly optimized site that doesn’t have a lot of cached pages but have a lot of static content.
then my conclusion was that you need to choose depending of your project requirement, to use apache or ngnix or both (yes, both can be used at the same time).
if you have a crappy php site, don’t bother you, ngnix don’t going to give you any improvement, better, invest your time to improve the code.
if you have a highly optimized site and cached most of their pages and you don’t bother to rewrite any htaccess or config file in this new format, ngnix will give you a improvement in your server.
if you have a mixed site, highly optimized, but not too cached her pages, you can have both running, ngnix serving static content and apache serving the dynamic content, this will improve in some way your site with a better load balancing proportional of the percentage of static files are serving.
i hope this help you to decide in this matter, i’ll post later a tutorial of how to install ngnix and apache togheter
Regards,
Shadow
Related Post
Hi,
when i installed the new 9.10 ubuntu in my new notebook, i realized time after the problem with the clicks in some flash app’s. was really troublesome, like see youtube videos or any other flash app i wanted to use/try.
today, after like 6 months with this problem i found the solution on this blog (in spanish). basically you need to edit the npviewer like this:
sudo gedit /usr/lib/nspluginwrapper/i386/linux/npviewer
and add this line before the last one:
export GDK_NATIVE_WINDOWS=1
save it and restart any browser that you have running
Regards,
Shadow.
Related Post
Hi,
recently i made some changes in a server where a svn was hosted, part of the changes was the change of the URL, so here i was having problem to commit the changes from my working copy. i tried to make a switch and a switch –relocate but any of them worked, some times is says the repository isn’t the same or some times is executed but the url wasn’t changed.
if you are in a hurry and can’t figure out how to make it work, just execute this command:
find /path/to/your/working/copy/ -type f -name ‘entries’ -exec sed -i ‘s|http://url/of/your/old/repository/|http://url/of/your/new/repository/|g’ {} \;
basically that going to replace all the url appearance of your old repository url to the new one, if you have branches or subfolders, maybe you need to execute this several times changing the strings, open a entries file inside the .svn folders to figure it out
i hope it help you
Regards,
Shadow.
Related Post
Hi,
thanks to a post on infosertec.com i get noticed this distro and i wanted to test it for a little to see how it works
(the review after the break,sorry for the screens, i tested it in a virtual machine
)
Related Post
Hi,
some new tips about subversion
if you need to update a web directory after someone make a commit just follow this guide: http://subversion.apache.org/faq.html#website-auto-update
i wanted to post this why it take me some time to figure out that a simple bash script don’t going to work and even if it worked with some tricks, i always getting a merge and not an update of the repository
some thing that the faq don’t mention is how to compile the program, if you are a newbie and don’t know how to do it, just run this command
gcc your_file_name.c -o your_binary_name
i hope it helps
Regards.
Shadow.









