web server – Internetblog.org.uk https://www.internetblog.org.uk Web hosting, Domain names, Dedicated servers Fri, 29 Jan 2016 11:05:52 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 https://www.internetblog.org.uk/files/2016/01/cropped-favico-32x32.png web server – Internetblog.org.uk https://www.internetblog.org.uk 32 32 Extra Large Log Files https://www.internetblog.org.uk/post/1530/extra-large-log-files/ Wed, 14 Jul 2010 19:13:00 +0000 http://www.internetblog.org.uk/post/1530/extra-large-log-files/ Linux syslog file
Question: One of my Linux system log files has suddenly become very large (several hundred megabytes). What should I do?

Answer: The first thing to find out is what exactly is happening in the log files. To see the latest log activity for your web server error log, for example, you would run:

tail -f /var/log/httpd/error.log

If the file is expanding, you should see errors popping up. When you are finished looking at it, press CTRL-C.

The next step is to fix whatever error you are receiving. If it is enough to fill up several megabytes or even a gigabyte of log space, it is a recurring error that should be fixed. For a web server, repeated failed connections could be some type of denial of service (DoS) attack. For a mail server, numerous open connections could mean that someone is using your server to send spam. The key is to find out exactly what the root cause is and then fix it. If you want to clear the log file, run:

> /var/log/httpd/error.og

Your logs will be back to normal size once your server is running normally again.

]]>
Using GZIP for Faster Websites https://www.internetblog.org.uk/post/1488/using-gzip-for-faster-websites/ Thu, 01 Jul 2010 15:56:55 +0000 http://www.internetblog.org.uk/post/1488/using-gzip-for-faster-websites/ tar/gzip iconGood webmasters and system administrators are always looking for ways to increase efficiency and create faster websites. While much of website speed depends on the speed of the server, network connection, and the design of the site, there are other software tweaks that can add some zip to your site. Gzip compression is one of those tweaks.

Gzip is a free and open compression method, developed by the GNU project (the same project responsible for a good portion of GNU/Linux). Gzip is also an RFC 1952 standard and is the most popular method for web compression. What essentially happens is that the browser (client) contacts the site (host) and receives a header that indicates that the file can be compressed with gzip. If the browser supports gzip, it will respond and retrieve the compressed file, extract the contents, and display. As a result, it takes less time to download content, thus reducing stress on the server.

Gzip can reduce response size by 70%, which means a tremendous amount of savings on bandwidth. Furthermore, nearly 90% of browsers used on the Internet support it, which includes all modern browsers. The older ones that do not support it are fading away quickly. Apache 1.3 uses a module called mod_gzip, while Apache 2 uses one called mod_deflate. Many content management systems have support for gzip compression built into the backend, if the user choose to enable it.

]]>
Apache HTTP Server Optimization: Part 3 https://www.internetblog.org.uk/post/1483/apache-http-server-optimization-part-3/ Wed, 30 Jun 2010 16:11:38 +0000 http://www.internetblog.org.uk/post/1483/apache-http-server-optimization-part-3/ Apache Software Foundation LogoStartServers

You have already configured Apache to control the number of child processes to keep running. This directive will tell Apache how many to start initially when your server first boots. Depending on the level of traffic you expect to get, this number may be low or high. For general purposes, 5 should be sufficient.

StartServers 5

Timeout

This controls the amount of time Apache waits to do a number of tasks. For example, it controls how long it waits for a GET request (i.e. for someone to download a page or images) and also how long it will allow a POST request (i.e. when someone is sending something on a form). The default is 300, but you can lower it to something like 150 to help reduce some server strain when it is waiting on failed attempts and also help prevent DoS attacks on PHP scripts like message forums. Do not set it lower than 90, however, as this may cause some of your site visitors to get timeout errors on working content.

Timeout 150

Once you have made all of the changes you want to make to your Apache configuration file (httpd.conf), you need to restart Apache:

service httpd restart
or
/etc/init.d/httpd restart

These tips are not the only ones you can use to optimize your Apache installation, but they should help you get a head start.

]]>
Apache HTTP Server Optimization: Part 1 https://www.internetblog.org.uk/post/1474/apache-http-server-optimization-part-1/ Mon, 28 Jun 2010 16:27:08 +0000 http://www.internetblog.org.uk/post/1474/apache-http-server-optimization-part-1/ Apache Software Foundation LogoWhen running your own dedicated server or even a VPS (virtual private server), it is important make sure your server is running at optimal performance. Apache, the web server of choice for many Linux system administrators, will not automatically make itself stable, secure, and fast. You must do that, and there are several optimization techniques you can use to accomplish it. This week, I will cover a few.

Apache configuration is stored in a file called httpd.conf or apache2.conf, and it most often stored in /etc/httpd or /etc/apache2. To edit the file, you can use “vi” or “nano”.

MaxClients

This setting defines the number of visitors you can have connected at once. You can calculate the visitor capacity your server can support by using this formula:

150 x number of GigaBytes of RAM

For example, a server with 2GB of RAM can have 300 MaxClients. 3GB can support 450. Make it high enough to prevent user timeouts but low enough to avoid causing the server to lockup. A high amount can also make your server an easy target for DoS (Denial of Service) attacks.

ServerLimit

Set this value to the same as MaxClients (i.e. SeverLimit = 150 x number of GB of RAM)

I will continue the series on Apache optimization throughout this week. You can also read your Linux distribution’s specific documentation on Apache to find out specifics, such as where the configuration file is stored.

Source: linuxstuffs.net

]]>
Using netstat to monitor a server https://www.internetblog.org.uk/post/1460/using-netstat-to-monitor-a-server/ Wed, 23 Jun 2010 18:50:16 +0000 http://www.internetblog.org.uk/post/1460/using-netstat-to-monitor-a-server/ Network iconIt is important to always keep a watchful eye on your dedicated server. Monitoring tools may be external, available through service providers, or internal, already included in your Linux distribution. One important internal monitoring tool is netstat.

Netstat can provide you with useful information about the ports that system services are using. For example, to display information about the services using port 80, type the following command:

netstat -ant | grep 80

The command by itself will show all of the instances running on every port, but you can limit the output to port 80 with grep. This is a quick way to see how many instances of port 80 (your web server) are actually running. If you want to count them, type this command:

netstat -ant | grep 80 | wc -l

Netstat has many other features that you can use to learn about your network ports and how they are being used. For complete documentation on netstat, type “man netstat” from the command line.

]]>
AMD toots its cloud computing horn https://www.internetblog.org.uk/post/1459/amd-toots-its-cloud-computing-horn/ Wed, 23 Jun 2010 17:59:50 +0000 http://www.internetblog.org.uk/post/1459/amd-toots-its-cloud-computing-horn/ amd computingIn a company blog post published Monday, AMD discusses the growth of cloud computing and explains how its products meet the new needs of the technology. Besides tooting its horn about its processors, the company hit the nail on the head when it comes to the cloud’s server requirements:

The explosion of digital data is fundamentally changing the dynamics of how servers are built, bought and deployed. The days of just throwing “raw” performance at the problem are long gone and the era of efficient computing with servers that balance price, performance and power is officially upon us.

Previously, we’ve been accustomed to monster servers with ten hard drives and a kilowatt power supplies. While these servers won’t disappear overnight, the web is all about scaling. Big servers are very expensive, but spreading out a load among many small servers is cheaper and more reliable.

Check out the above video for some pretty cool statistics about cloud computing.

]]>
Understand absolute and relative paths https://www.internetblog.org.uk/post/1217/understand-absolute-and-relative-paths/ Fri, 16 Apr 2010 18:36:31 +0000 http://www.internetblog.org.uk/post/1217/understand-absolute-and-relative-paths/ Joomla configuration file showing paths
When dealing with a web server, it is important to understand the relationships of one file to another, those files to the server, and those files to the Web. When creating hyperlinks or configuring various website options, particularly PHP or Perl scripts, you will need to know both absolute paths and relative paths.

Absolute Paths

There are two types of absolute paths you will encounter. The first is directly related to the Web and the website’s domain name. For example, the path to myfile.html might be:

http://www.mywebsite.info/folder/folder3/myfile.html

On the server, the absolute path would be something like:

/home/user/public_html/folder/folder3/myfile.html (useful in configuring scripts)

Relative Paths

With a relative path, the server looks at where the user currently is then moves either forward deeper into a directory or goes up to any number of parent directories. For example:

folder3/myfile.html

Inside the html file, you might need to link to an image in a directory that is two steps higher:

../../images/myimage.jpg (which is the absolute path: http://www.mywebsite.info/images/myimage.jpg)

With this knowledge, you should be able to link within documents and configure scripts.

]]>
Change a URL with mod_rewrite https://www.internetblog.org.uk/post/1186/change-a-url-with-mod_rewrite/ Thu, 08 Apr 2010 21:18:07 +0000 http://www.internetblog.org.uk/post/1186/change-a-url-with-mod_rewrite/ Apache Software Foundation LogoQuestion: My current website URL looks like http://mydomain.com/index.php?page=creative. How can I remove the index.php and question mark to make it look more like a regular page address?

Answer: If your web server is Apache, you should be able to do this with mod_rewrite. If you have a shared hosting account, first make sure that your web host has enabled mod_rewrite. Then, create an .htaccess file or edit your current one, placing the following strings inside it:

RewriteEngine on
RewriteRule ^([^/\.]+).html$ index.php?page=$1 [L]

The above will change http://mydomain.com/index.php?page=creative to:

http://mydomain.com/creative.html

This will make it easier for users to remember your URLs and possibly for search engines to index them.

]]>
Offering web-based email on your web server https://www.internetblog.org.uk/post/1165/offering-web-based-email-on-your-web-server/ Fri, 02 Apr 2010 20:37:11 +0000 http://www.internetblog.org.uk/post/1165/offering-web-based-email-on-your-web-server/ Hula mail screenshot
These days, many email users rely on free services such as GMail or Yahoo! Mail for their messaging needs, but these services lack the customization that some business customers may want (i.e. myname@mydomain.com). For that, they have two options: setup cloud services with Google or another service provider, or use the email accounts offered by their web hosting providers.

If your web hosting customers opt for the latter, you have some things to consider. POP3 and IMAP offerings are a given, but if your customers want a web-based option, you will need to provide one. Some hosting control panels come with web-based email solutions. If you have that option, use it.

If you do decide to install your own web-based email, make sure you choose secure, well-tested software that is easy to upgrade and maintain. The last thing you want is to have to manage poorly written software and spend your time fighting off hackers who exploit its security holes. Finally, make sure that things like quota control limits are easily enforceable and that the server load is not too high. You and your clients will hopefully be happy with the results.

Photo Source: Wikimedia Commons

]]>
Quad-Core vs Dual-Core servers https://www.internetblog.org.uk/post/1127/quad-core-vs-dual-core-servers/ Tue, 23 Mar 2010 15:32:31 +0000 http://www.internetblog.org.uk/post/1127/quad-core-vs-dual-core-servers/ Server with two dual-core chips
Many web hosts are proudly offering servers with single quad-core processors or with two dual-core processors. While they certainly sound impressive, are there actual benefits? Does a quad-core system deliver better results than a dual-core of the same processing speed? The truth is that it depends on what the server’s applications need.

For a dedicated server that is running a single web server (even with virtual hosts) and maybe a single database server, quad-core is probably overkill and will not produce any tangible benefits. For quad-core to be beneficial, there needs to be at least three CPU-intense processes running simultaneously.

An example of of when a quad-core server makes sense is when there are three, four, or more intense web applications running that all access databases. Another example would be a virtualization situation, where the server is running dense virtual machines that require their own processing power. In such a case, the benefits of a quad-core system is that compartmentalization. There also seem to be indications that have two dual-core processors has benefits over a single quad-core processor for the same reasons mentioned above, although I have not seen any proven data to confirm it.

Photo Source: Flickr

]]>