Before I start with the nonsense, I want to say, that I am not very advanced with web hosting and all I will write is the experience I have gained in recent times 2-3 months. I administer a fairly busy VPS in terms of traffic, according to tyxo is in the top 80 but enters the top 70 ;). That's my thought, that after so long I have acquired various habits and reached good practices in one way or another (usually more difficult) :D. I will not even write or go into the details of the configuration at all. Rather, I will share ideas to think about.

  1. Update the software regularly. Apache, php mysql all wants updates. Whether to patch holes in the security, whether due to fixed bugs or new features. Always keep your software up to date. In general, it is rare to drill a server through the applications, usually through holes in the code of the hosted things, but let's not rely only on this.
  2. Apache – it is not desirable for your web server to have more active modules than the ones you actually use. The more modules on- slow work.
  3. Multiple users on the same server – opcode cache. Some time ago I wrote Besides zerdion do satisfactory tests and see the real benefits of this magic. In my case I chose eAccelerator because in a real working environment it shows the best results with all the settings to it. Faster loading with less eating resources, which means more users.
  4. They push you with traffic – gzip. The easiest way to reduce the real traffic you make is with gzip compression of http responses to the client. Mod deflate is the apache solution. For other http servers I have not researched the issue :). Real around 50% I lost traffic when compressing on html,css,js,xml. I need to see if I can compress other types of content as well. Because real photos are the content that makes the most traffic in a site.
  5. mysql serer – I highly recommend it if you haven't been awarded a version 5.1 to do it. In general, Oracle has some small experience with databases 😆 and this experience has put it well into 5.1 version I have not tried 5.5 but I plan to do that soon. Definitely speeded up the work of sql queries maybe slightly dropped the load but by no more than 5-6% but also the new functionalities for the programmers are wonderful. The basic one partitions. When upgrading, be careful what settings you have in my.cfg Not all old options are valid, it's also a good idea to remove old libraries at least with CentOS 5.5 made problems with Debian I did not have such annoyances. Then look at the mysql log because some of the options have different names and it is good to change them if you go to 5.5 don't wonder why your configuration doesn't work.
  6. sql queries. Be sure to enable the slow query recording option. In these logs you can return information to the programmers if you are not for slow requests to be optimized. The fewer such requests the less load on your server 😉
  7. A little protection – change the default port of ssh you don't need crazy bots to try to hack you. Apache secure it with mod_security quite a useful module makes filtering on quite a bit – sql inj, rfi DDoS and others. It won't stop a lot of fuss, but at least the lamers will weed them out. PHP is a good idea to protect with Suhosin. It can be put as an additional extension or directly as a patch in the php code. I personally prefer the first one I think is cleaner.

For starters, these are the things I can think of. They are not many and when I think about it I have done a lot of optimizations on the server but many of them are quite specific according to the situation and there is no point in explaining them such as cache limits or how many processes the apache has been raised. Probably in time I will think of more things that are how to say some of the little things that give the big result.. The machine is quite well optimized for comparison we make 20k unique visits per day and we are on the lowest possible vps plan load time on the pages we do not exceed 1,5-2 sec or if it exceeds it is due to external sources of ads otherwise the page itself spits out for fractions of a second. People close to us have non-optimized servers with a lot more resources than ours and have the same results. In general, his mother is optimizing and her father is drinking beer

ps The song is slightly related to the theme 😀

I decided to write another useful stat for a simple web server covering basic Apache needs, PHP and MySQL 🙂 in general I will not go into specific settings and so on because then I would name the article Perfect WEB Server 😉 with a little desire things can always go on 😉 In general, a few words about what we will need какво

1. Apache2 😉 the newer the less well-known exploits or lack of them do not need more comments

2. PHP5 well, it's coming soon 6th version 4th is officially discontinued so we won't deal with old things 🙂

3. MySQL5 version 6 is in alpha stages, I don't want it to crash with fresh files 😉

In general, most modern distributions contain the necessary packages in storage 😉 and the installation itself will run as smoothly as possible if you use your installation tool apt-get slapt-get, emerge, yim, iast 🙂 it.n

So things written for Debian I think with little or no correction will be relevant for other dristrots and for Debian derivatives things 100% will work, so the installation follows:

apt-get install apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysql php5-mysql phpmyadmin

in general these are the packages you need to work in general only after installation you restart the apache to catch the settings and you should now be able to use your web server. Default /var / www / е вашата уеб директория.Общо взето леко ще пипнем конфа на апачито че да можем да разрешим PHPMyAdmin-a отворете с любимия си редактор /etc/apache2/apache2.conf като най накрая на фала добавяме

# Enable PHPMyAdmin

Include /etc/phpmyadmin/apache.conf

Then we restart the Apache at http://localhost / phpmyadmin is available phpadmin a

If during the installation Mysql did not ask you for a password, it is good to remember it later with the command

mysql -u root

You will be asked for a password shake enter or you will not be asked at all 🙂 then run

SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘123456’);

by replacing 123456 with your password 🙂 and write exit then write

mysql -u root -p

and you will be asked for your new password 🙂 Well in general this is 🙂 Changing the password is the most- a little because you log in with the username and password for the database in PHPMyAmin a

For M $ most- the easy option is to download WAMP the package is installed by default in c:\wamp if you have skype installed it is good to stop using the 80th and 443rd port because by default the apache uses the 80th 😉 so it is easier to stop from skype instead of picking up the apache config, although if you are going to stock up on more serious things you will have to touch it here and there 😉 You already have a record as you have everything ready c:\wampwww web directory

In general, I highly recommend that you use such things under Linux because many codes do not work perfectly below M $ or do not work at all.. 🙂

A little advice if you have decided to share the hosting and you have a dynamic IP or you are behind a router with such a thing 😉 You can use it quite successfully NO-IP projects which for Debian is still available through apt-get 🙂 In general, when registering on this site you will be given a domain which at a certain interval turns to the computer software to update your IP address., if you are behind a router you need to configure in the router itself forwording rules for your IP in your internal network.

I haven't scratched anything in a long time – laziness and total lack of time. Because now I'm fixing my blog because according to the old custom of the shoemaker, his children are barefoot, so did my site under any criticism. Now I updated to the latest version of WordPress to keep the guys alive and well for their work, saturated very cool has been obtained. Maybe one day when I have more time to write another shit I will slap a new add-on for the WP. So now to brag a little, that is, to show off how happy I am with life and how I am the best- the big one. For starters I bought my dream hard drive SeaGate 320GB SATA2 16MB cache 🙂 sounds sexy right 😉 . I am also equipped with a new monitor Samsung SM920NW I could not praise him, it's a little pearl (small 19 inch). Satisfied is good I've worked a lot TFT-but this lightly wipes everyone in its path, especially Philips, that I have at home and at work one,em expensive em nestruvat 😛 . So my thought was that it has normal characteristics and is at a modest price of BGN 370, which is not much for such a good performance.. True from the design is not something impressive but what a picture 😀 . Well, in general, these are my new acquisitions. Now to brag a little about what a great program I am 😉 . I already have a surfer built entirely by me – a modest torrent. I equipped the machine with Debian 4.02r netinstall and just fell asleep. For a torrent system I installed it Btit Tracker v.1.4.7 a really good one, easy to manage and modify system. While I was reworking it to make it suitable and user-friendly, I even made my own mods (or mods of mods rather) 😆 хихихихи. It is a pity that the machine will not see the light of day, it will be a local torrent tracker for 100 people in a neighboring village 🙁 . Another achievement in my humble programming knowledge is that MySQL it's bad 🙂 a few times it happened to me that there was no reason for the database to fall 🙁 and then, by walking on the side of God, I fixed them, which on the one hand is nice that I saw almost all possible variations for correction based on data. The more I use PgSQL so boldly can I say that he is the good :mrgreen: the only thing i don't like about it is the nasty administration, but what does my head understand I'm still on- a good programmer rather than an administrator. It took a long time again 🙂