Categories
Ubuntu

Httpd.conf – What’s its Location on Ubuntu?

Here’s where to find the Apache 2 web server configuration file httpd.conf on Ubuntu.

Did you know that on Ubuntu, the main Apache configuration file is not httpd.conf? The main Apache config file is actually apache2.conf.

When Apache 2 reads apache2.conf, the contents of httpd.conf is included by an include directive in apache2.conf. Here’s the lines from apache2.conf that include httpd.conf:

# Include all the user configurations:
Include /etc/apache2/httpd.conf

So use httpd.conf on Ubuntu is specifically for your servers specific configuration. You may still need to want to edit apache2.conf at times, to change Apache’s configuration rather than add to it.

Httpd.conf Location

On Ubuntu, httpd.conf is located in the directory /etc/apache2. apache2.conf is also located in /etc/apache2.

Httpd.conf Location for Specific Ubuntu Versions

To ensure these locations are accurate, I’ve checked httpd.conf’s location on a number of different Ubuntu versions. The definitive article is Where is Httpd.conf’s Location on Ubuntu? at Ubuntu Gods.

Ubuntu Version httpd.conf Location
Ubuntu 7.04 Feisty Fawn /etc/apache2/httpd.conf
Ubuntu 8.10 Intrepid Ibex /etc/apache2/httpd.conf
Ubuntu 10.10 Maverick Meerkat /etc/apache2/httpd.conf

Additions & refinements welcome!

Categories
Linux

How to See Hidden Files on Linux, Mac and Unix

Files and directory names starting with a dot are treated as hidden files on operating systems derived from Unix. That means you won’t normally see these dot files in Mac OS X, Linux, FreeBSD or enterprise Unix.

Linux includes Ubuntu, Red Hat, CentOS, SuSE, Debian, Fedora & Mandriva. Unix includes Enterprise Unix like AIX, HP/UX and Solaris.

Hidden files are typically used for configuration or program history. For example:

  • .bash_history contains a Unix user’s shell configuration.
    (A Unix shell is used to enter text commands.)
  • .ssh is a directory holding configuration files for SSH.
  • .bash_history keeps the history of shell commands entered.
  • .htaccess is used to override a folder’s Apache configuration.

Files are typically hidden so they don’t distract from the files people usually work with, such as documents, movies or music.

To list hidden files in a terminal session, add the -a option to the ls (list files) command. Here you can see the difference from a normal ls:

Tazs-MacBook-Air:~ taz$ cd /Users/taz

Tazs-MacBook-Air:~ taz$ ls
Backups		Movies
Desktop		Music
Documents	Pictures
Downloads	Public
Library		Sites

Tazs-MacBook-Air:~ taz$ ls -a
.
..
.CFUserTextEncoding
.DS_Store
.Trash
.Xauthority
.bash_history
.cups
.fontconfig
.lesshst
.mysql_history
.ssh
.viminfo
Backups
Desktop
Documents
Downloads
Library
Movies
Music
Pictures
Public
Sites

The cd command means change directory to.

There are two special files in this listing. The single dot file “.” is the current directory. The double dot file “..” is the parent directory. To see how this works:

Tazs-MacBook-Air:~ taz$ pwd
/Users/taz

Tazs-MacBook-Air:~ taz$ cd ..

Tazs-MacBook-Air:Users taz$ pwd
/Users

The pwd command means print working directory.

I’ve tested the commands above for working with hidden files on Mac OS X 10.7 Lion, Mac OS X 10.6 Snow Leopard (10.6.7, 10.6.8), Ubuntu Server 7.04, Ubuntu Server 10.10 LTS, Ubuntu Desktop 10.04, CentOS 5.1, 5.3 & 5.4, Red Hat Enterprise Linux 5.6, as well as ancient HP/UX, AIX and Solaris versions. They should work on nearly every Unix-based system.

Hackers sometimes hide files using dot files.

Nearly all file transfer programs provide an option to show hidden files. Dot files like .htaccess are essential for some websites to work. Dot files can be a security risk. Many file transfer programs show files starting with a dot by default.

If you have more questions about hidden files, please post a comment below.

Categories
Linux

What’s the Best Linux Distro according to Google?

What’s the best Linux distribution? Here are the top Linux distros according to global search volumes in Google.

Best Linux Distro by Number of Google Searches

One way to find the most popular Linux version is to look at the number of Google searches.

Here’s the most popular Linux distributions by number of general searches:

[table id=1]

(Source: Google Keyword Tool, last updated 3 August 2010)

These search volumes can be interpreted as the level of interest and activity for a particular Linux distro. You could argue a Linux distro gets more searches because it has more problems!

It’s mostly the usual suspects at the top of the table: Ubuntu, Debian, Fedora, Red Hat, Suse, CentOS, Gentoo, Mandriva (formerly Mandrake) & Knoppix. The KDE version of Ubuntu, Kubuntu, pops into the top ten with the same number of searches as Mandriva. Linux Mint, a distro derived from Ubuntu, focussing on usability, is ranked twelfth.

Ubuntu is the gorilla in the room, with 56% of searches. Wow. I knew Ubuntu was popular, but I had no idea that it is seven times more popular than any other distro.

A surprise for me was to find gOS, a Linux version I hasn’t heard of, in the top ten. gOS or Good OS is an Ubuntu derivative focussed on web-based applications (like Google Docs). It looks like the gOS distribution hasn’t been updated since 3 January 2009. For an eighteen month old distro to have this much popularity, gOS must have something special. The screen shots look really good, showing a sexy interface, that’s at once Mac-like, but also unique.

Notes on General Search Volumes

Note 1: These search numbers are from the Google Keyword Tool for phrase matches, which means any search containing the keyword is included in the search volume. For example, the searches “ubuntu”, “install ubuntu”, “ubuntu iso”, “download ubuntu” would all be included in the search volume numbers for Ubuntu above.

Note 2: These two major Suse distros, openSUSE (open source) and Suse Linux Enterprise (commercial), can’t be meaningfully separated at the level of searches. Their search numbers are combined above.

Note 3: Puppy Linux, Arch Linux and other Linux distros where I’ve added “linux” to their keywords may be disadvantaged in the measure. Since they don’t have a unique brand name, I’ve had to add “linux” on the end. (C’mon, I can’t count all the searches for “puppy” towards Puppy Linux!)

Popular Linux Distros By Number of Download Searches

The number of general searches for a Linux distro names indicates the current popularity of a distro. The search volumes above include queries like “update mysql on centos”. What the numbers of general searches doesn’t show, is what distros people are searching to install.

For that reason, I’ve compiled most popular Linux distributions by number of download searches:

[table id=2]

(Source: Google Keyword Tool, last updated 3 August 2010)

These search volumes can be interpreted as what versions of Linux people are actually installing.

There are some big differences in the number of download searches compared to the number of general searches. Fedora and Red Hat take positions two and three for download searches, ahead of Debian. Gentoo, popular in general searches, falls to position 14 for download searches. Downloading gOS seems less popular than just searching about it, with gOS ranking 17th in download searches, while being 10th for general searches.

Just because an operating system is a popular download, it doesn’t mean it’s actually getting used a lot. It’s more than common for Linux distros to just be downloaded for people to take a look.

Puppy Linux (from general search rank 15 to download rank 8), Arch Linux (from rank 16 to 14), Sabayon (from rank 28 to 18) and Linux Mint (from rank 12 to 10) are disadvantaged in the general search numbers due to the lack of a unique brand keyword.

Notes of Linux Download Search Volumes

Note 1: These search numbers are from the Google Keyword Tool for phrase matches, so, for example, searches for “download ubuntu” and “download ubuntu 8.04” “download ubuntu hardy heron” will be counted towards the searches for “download ubuntu”. Other download phrases that don’t include the words “download ubuntu” in that order are not included, e.g. “ubuntu download” or “get ubuntu”. These search volumes for these keywords could have been included, but these numbers are meant as an indicator of popularity only.

Note 2: Linux variants that were disadvantaged in the general search numbers above by having “linux” appended to their name (e.g. “puppy linux” instead of “puppy”) are probably more fairly represented in table of download search volumes. While we needed the phrase “puppy linux” for general searches, the phrase “download puppy” is probably specific enough, rather than needing “download puppy linux”. (Or perhaps there are children out there right now, hoping to download a puppy…)

What Version of Linux does Google use?

Almost half of Google’s employee use Google’s custom version of Ubuntu, called Goobuntu. Note that Goobuntu is not available outside Google.

So there’s a big vote for Ubuntu.

I don’t know if Goobuntu is also used on Google’s servers. Mark Shuttleworth suggests Google probably uses a variety of Linux variants.

Best Linux Desktop Distro

There is no best Linux desktop distro. The distros are different. They suit different people.

For example, some distros are simple, using the maxim “just one application for each job”, while other distros are feature rich. There are distros that focus on work well out of the box, providing accelerated graphics drivers, Flash and common video formats at install time, while other distros focus on power users or using only pure open source. Some distros provide powerful graphical environments like Gnome or KDE, while others use a lightweight graphical environment like Xcfe, or a bleeding edge graphical environment like Enlightenment.

With the intelligence and passion that has gone into Linux’s software engineering, there are many excellent Linux desktop distros. You’re probably best off trying a LiveCD, USB key or VM version to see which one works best for you.

If you’re looking for a good starting point, go for Ubuntu.

Best Linux Distro on a USB Key

My suspicion is that Puppy Linux would take the crown on this one. Why? It’s small. It’s very fast – it runs entirely from the computer’s RAM. It’s compatible with Ubuntu packages, so there’s access so an incredibly large software base.

If you are using your USB key Linux for specific tasks, such as system recovery or disk partitioning, you might select another more specific distro, like SystemRescueCd or Parted Magic.

Best Linux Server Distro

Are you looking for the best Linux server distro to run your web server or database on?

The requirements for a Linux server are quite different to a Linux desktop. Reliability, scaleability & security are more important for a server, as a server is shared by many users. Slow service, no service or being hacked has a bigger impact on a server.

Here I would tend to steer towards the Linux distros which have existing massive deployments, as their widespread use will tend to have flushed out most scaleability, reliability & security issues. Widespread deployment also typically means there is a wider community for support.

The Linux distros with massive server deployments are CentOS, Debian, Red Hat, Ubuntu, Fedora, Suse, Gentoo, Mandriva, and for Japan, Turbolinux. All of these Linux variants are probably are good choice for production use.

Here is each distribution’s marketshare of webservers, as measured by w3techs.com:

[table id=3]

(Source: Historical trends in the usage of Linux versions for websites,
last updated 3 August 2010)

If you look at the stats or graph on the source webpage, you’ll see the proportion of webservers using CentOS & Ubuntu is climbing, and for all other major Linux variants, it’s falling. It’s worth noting that the use of the Linux variants whose proportion is falling is probably still increasing, as the number of webservers in the world is increasing.

There is also a decision to be made between commercial offerings and free software. The commercial offerings have paid support, which could be invaluable if there are problems. Note I have seen several posters on the web, running both small and large Red Hat deployments, saying their experience of Red Hat’s support has not been good.

If you are running Oracle, consider running Oracle Enterprise Linux, which is based on RHEL. Oracle have been enhancing Linux for their database for many years now.

CentOS

CentOS is a free clone of Red Hat Enterprise Linux (RHEL), built from Red Hat’s source code. You can take almost everything good I say about CentOS and apply it to RHEL. Red Hat has a reputation from being conservative with the features it puts into RHEL, so it is stable and well tested. Apparently Red Hat puts the more bleeding edge features into Fedora first.

Personal Experience of CentOS, Debian & Ubuntu for Server Use

I’ve got a fair bit of driving time on CentOS for production web & database servers. At first I found CentOS very primitive, with fairly low-brow terminal defaults (e.g. no use of color). Over time, I come to appreciate the strength and scaleability of CentOS. It works very well with 16GB of memory and 16 cores.

I’ve found CentOS to be rock solid. I have never had a server crash for the four thousand websites we’ve had running on it. Despite having some very large MySQL and PostgreSQL databases, I have had one only data corruption in 2008. This was in a forty five million row MyISAM table, and the issue could have been MySQL code or the disk controller hardware rather than CentOS.

Adding software in CentOS, for example PHP extensions, to CentOS has been a snap. Everything has been a single line install, and has worked first time.

If had a production Debian server for awhile. I found Debian’s directory layout and terminal defaults helped me be more effective. As well as web and database duties, the server also served HD broadcast-quality video downloads. Debian performed flawlessly, though the server was never seriously loaded. We did have small issues with the default PHP extensions (e.g. the gd graphics library, which needed to be recompiled for our purposes).

I’ve only used Ubuntu as a server in a development VM. It worked perfectly, operating very similarly to Debian. (Ubuntu is in fact based on Debian.)

Best Linux Server Distro Conclusions

Any of the Linux distributions in massive deployment should work well for you.

If I personally had a large, mission critical system I would use RHEL or it’s free clone CentOS. Half of the world’s webservers are running Red Hat or CentOS, and I know from experience they are reliable & scaleable. If I had a non-critical system, I would love to try out Ubuntu to see if it works as well as a server as it does for desktop.

Can I Use the Desktop Version of a Distro as a Server?

Many distros have a server version and a desktop version. You can use the desktop version as a server – Apache and MySQL are usually only a few clicks or commands away from being installed & activated. Using the desktop version of a Linux distro is fine for development.

For production servers, always use the server version of a distro. The server versions configured & tuned for server tasks. For example, there are several disk IO schedulers for Linux. The default disk IO scheduler for the desktop version of a distro might perform badly for a database server.

Should I Use the 32-bit or 64-bit Version of my Distro?

Linux Server distros usually come in a 32-bit or 64-bit version. Which should you use?

32-bit is used by the majority of servers out there, and hence has had most issues fixed. The downside is you’re limited to 4GB of RAM.

We used to have frequent issues with 64-bit. The kernel was fine, but the 64-bit versions of the software frequently had bugs or interoperability issues. 64-bit is now common enough that most of the issues have been worked out, and I haven’t had and 64-bit issues for the last year.

64-bit software is usually a bit faster and uses more RAM.

We have frequently had circumstances where we wanted to add RAM to a server to increase capacity, e.g. for the Linux file cache, memcached, database cache or full text search cache, but the server was running a 32-bit distro and RAM was already at the 4GB limit. I recommend to run the 64-bit version of your distro, so you have the flexibility to add over 4GB of RAM to your servers. You might even get a bit of a performance boost!

Conclusions for Choosing Your Linux Distro

The short answer is for many people, the best linux distro for servers is CentOS, and the best Linux distro for desktops is Ubuntu.

Comments, corrections, feedback and “you forgot this obvious important Linux distro” messages welcome!

Categories
Ubuntu

How to Find Your Ubuntu Version

To get your version of Ubuntu, run either of these commands from a terminal session.

To start a terminal session in Ubuntu’s graphical desktop go to the Applications menu and choose the Terminal item).

There are at least two ways to get the Ubuntu version.

Find the Ubuntu Version from the /etc/issue File

List the contents of the /etc/issue file to see the Ubuntu version.

taz@tasman-desktop:~$ cat /etc/issue
Ubuntu 8.10 \n \l

Note that the contents of the /etc/issue file is displayed for local terminal logins to Ubuntu. If you don’t see Ubuntu version information like that above, then the system administrator may have edited this file. You can try the next method.

Check the Ubuntu Version from the /etc/lsb-release File

Displaying the contents of the /etc/lsb-release file will tell you the version of Ubuntu you’re running.

taz@tasman-desktop:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"

These methods were tested on Ubuntu 8.10.

Categories
Apache

Httpd.conf’s Location on CentOS, Ubuntu, Red Hat, Mac and Others

Here’s where to find the Apache 2 web server configuration file httpd.conf The httpd.conf directory differs across Linux & Unix variants like CentOS, Mac OS X, Red Hat, Ubuntu and XAMPP Mac.

This table lists the httpd.conf location for each operating system:

Operating System / Linux Distro httpd.conf Location
CentOS 5.2 /etc/httpd/conf/httpd.conf
CentOS 5.3 /etc/httpd/conf/httpd.conf
Mac OSX 10.6 Snow Leopard /etc/apache2/httpd.conf
Mac OSX 10.7 Lion /etc/apache2/httpd.conf
Red Hat Enterprise Linux Server 5.6 Tikanga (RHEL) /etc/httpd/conf/httpd.conf
Ubuntu 7.04 Feisty Fawn /etc/apache2/httpd.conf
Ubuntu 8.10 Intrepid Ibex /etc/apache2/httpd.conf
Ubuntu 10.10 Maverick Meerkat /etc/apache2/httpd.conf
XAMPP on Mac /Applications/XAMPP/etc/httpd.conf

For more specific information on Ubuntu, see httpd.conf location on Ubuntu.

The location for Fedora will likely be the same as CentOS (same distro family).

The location for Debian will likely be the same as Ubuntu (same distro family).

If your operating system or Apache package isn’t mentioned here, you can use the find command on Linux, Unix or Mac to find httpd.conf, e.g.:

find / -name httpd.conf 2>/dev/null

On Windows, you can use the search facility of Windows Explorer to find httpd.conf.

Additions & refinements welcome!