Hack and / - Your Own Personal Server: Blog
This column is the third in a series about how to manage your own services on your own server. In the first column, I discussed how to make sure your home network is ready to host your own services. In the second, I covered DNS, and in this column, I talk about one of the services people commonly put in the cloud but is simple to host yourself: a blog.
At first, I planned to focus this series strictly on how to set up your own Web server, but I realized that these days, most people don't simply set up Apache and upload some static HTML. Instead, most modern sites are built so that their content is generated dynamically, often with data stored on a database. Instead of just a basic static page, today if you want to set up your own Web server at home, you probably want to host a forum, post some information about yourself, share some pictures or, quite likely, manage your own blog.
Many different types of blogs exist—from sites that attempt to replicate the function of a physical magazine on the Web to sites that act as a person's public diary to sites that just link to other interesting content. And, just as many different types of blogging software are available under Linux. Each type of blogging software has its advantages and disadvantages, but for the purposes of this article, I had to pick one. I chose WordPress because it's relatively simple to set up and has a large user base, which means it should be easier for you to get support from the community.
I not only had to choose what blogging software to cover, I also had to decide on a base distribution. When it comes to Apache and WordPress, although the software itself is basically the same across major Linux distributions, the organization of that software can be quite different. Because I'm aiming this column at someone who has never set up a Web server before, I'm going to use Ubuntu Server here (specifically 10.04 LTS), as I think the way it has organized Apache configuration and WordPress is the most friendly for the new system administrator.
The first step in the process is to install WordPress, Apache and all of the dependencies this software needs. On a modern Linux distribution, this is relatively simple. In the case of Ubuntu, simply type the following into a terminal:
$ sudo apt-get install apache2 mysql-server wordpress
Those packages will pull down the Web server software, the MySQL server that WordPress will access on this same machine and WordPress itself, along with all of its dependencies. During the install, you will be prompted to choose a password for the MySQL root user. Although you optionally can leave this blank, I advise you to choose a password and document it somewhere. If you decide to leave it blank, you always can add a password to the root user later, but it's much simpler to set it here.
Apache2 under Ubuntu (and Debian-based distributions in general) has a somewhat unique way to organize Apache configuration. If you ever have managed multiple Web sites on a single Apache instance (often referred to as virtual hosts), you know how challenging it sometimes can be to organize each site's configuration along with all the modules you need Apache to load. Under Ubuntu, all of the currently available virtual hosts and modules store their files under /etc/apache2/sites-available and /etc/apache2/mods-available, respectively. Any virtual hosts or modules that are enabled are set up as symbolic links under /etc/apache2/sites-enabled and /etc/apache2/mods-enabled. Along with this new organization, the apache2 package includes a set of new tools to enable and disable sites and modules. For instance, if you added a new virtual host configuration at /etc/apache2/sites-available/foo and wanted to enable it, you would type:
$ sudo a2ensite foo
That command creates the necessary symlinks for you in /etc/apache2/sites-enabled. Likewise, if you wanted to load a module named cgi that you see under /etc/apache2/mods-available, you would type:
$ sudo a2enmod cgi
To undo the above two commands, you would type:
$ sudo a2dissite foo $ sudo a2dismod foo
Although it's true that you could set up these symlinks manually, the included commands certainly make it more clear and easier to script.
Kyle Rankin is a VP of engineering operations at Final, Inc., the author of a number of books including DevOps Troubleshooting and The Official Ubuntu Server Book, and is a columnist for Linux Journal. Follow him @kylerankin.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- My +1 Sword of Productivity
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide