You’re probably here because you are finally at the point where you need root access to your web server so that you can install applications like MediaWiki or WordPress or Joomla or any other CMS. If you have a website that you want to move away from a hosted environment, this is how to set yourself up so that you control every aspect of your site.
- Create an account at Rackspace.com. Go to Cloud Servers and create a new server. If you need help with this, though it’s very self-explanatory and easy on their site, you can always chat with their 24-7 online chat support. Note the administrative password and the IP address of the server you have created.
- Open a bash terminal and SSH into your shiny new server. “ssh root@YOURSERVERSIPADDRESS”. Enter the password.
- Create a user for yourself. “useradd -m -s /bin/bash yourname” and create a password for yourself “passwd yourname”.
- Enter “su
yourname”. Now, you are logged in under your name and not as root. - Enter the following:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install tasksel
sudo tasksel install lamp-server
sudo apt-get install php-mail python-software-properties unzip
sudo a2enmod rewrite
sudo apt-get autoclean
sudo apt-get autoremove
mkdir /home/yourname/yourwebsitename
mkdir /home/yourname/yourwebsitename/blog
cd /home/yourname/yourwebsitename/blogsudo
wget http://wordpress.org/latest.tar.gz
sudo tar -zxvf latest.tar.gz . - That has cleaned up your server and installed a web server as well as WordPress. Enter passwords for your MySQL database and record them.
- “sudo service apache2 restart” #You will get an error that local server has not been set up.
echo “ServerName localhost” | sudo tee /etc/apache2/conf.d/$servername
sudo service apache2 restart #Should be no error now - cd /etc/apache2/sites-available/
sudo nano yourwebsitename - Copy this with CTRL+SHIFT+V into the terminal:
ServerAdmin webmaster@localhost
ServerName www.yourwebsitename.com
ServerAlias yourwebsitename.com *.yourwebsitename.com
DocumentRoot /home/yourname/yourwebsitename/
php_value upload_max_filesize 1MOptions +FollowSymLinks
AllowOverride All
Order allow,deny
allow from allOptions Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from allErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warnCustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ “/usr/share/doc/”
Options Indexes
MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128- CTRL+X and save the file as yourwebsitename.com.
- cd /etc/apache2/sites-enabled/
r
sudo ln -s /etc/apache2/sites-available/yourwebsitename.com /etc/apache2/sites-enabled/yourwebsitename.com
sudo service apache2 restart
- Where have you created your domain name account? If it’s with GoDaddy, login to your GoDaddy account and click on Domain Manager. Click on the website name and enter the dashboard (or follow whatever practice your domain registrar uses to get to where you can edit the zone file). Click on “Edit Zone File”.
- Replace the IP address in the zone file with the IP address of your cloud server. Save the zone file.
- “nano /home/yourname/yourwebsitename/index.php” and copy this into the file.
/**
*
Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*//**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require(‘./blog/wp-blog-header.php’);
?>;
- In a few minutes, you should be able to enter your URL into any browser, and see the WordPress installation page. Install using the database name and password you’ve created in PHPMyAdmin or in command line for MySQL.
- I recommend Elegant Themes to get a beautiful and professional look for your site instantly.
This is not working for me. Am using RedHat Linux…
sudo apt-get update , the command is giving error that the user not in sudoers list
Ok, your problem is that your user doesn’t have the ability to use the ‘sudo’ command. ‘Sudo’ is a command that gives you temporary root access. Do you have a way to get root access? Try typing in ‘su’ and use the root password. If you don’t have the root password, then this will be more complicated. If you do, use this command: “adduser username admin” where ‘username’ is your username. If you don’t, let me know.
@technophilo: Redhat linux does not use apt-get… it is rpm based. Apt-get is for debian-based linux distributions, such as Ubuntu.
You're right; I wanted to get him all the way through "sudo" first, though 😉
So I've got a client who is using RackSpace Cloud and has 1 site running on Ubuntu, we're porting an existing WP install but we're doing some work on it first to change the GUI. Hence I need to set up a dev site on this server and while I can mkdir I'm not a Linux expert and I don't know how to get to the directory that I've created without changing the DNS (as described above). I don't want to point to this yet, as we have a few weeks worth of stuff to do first.
Is there an easy way to get to the installed directory via a browser and FTP client so I can start to work on the template and things? Thanks btw for the instructions they were helpful (though I too had to su to root in order to run all the commands).
So I've got a client who is using RackSpace Cloud and has 1 site running on Ubuntu, we're porting an existing WP install but we're doing some work on it first to change the GUI. Hence I need to set up a dev site on this server and while I can mkdir I'm not a Linux expert and I don't know how to get to the directory that I've created without changing the DNS (as described above). I don't want to point to this yet, as we have a few weeks worth of stuff to do first.
I usually use a spare domain name, set up the virtual host to point to the new development directory, and use that for dev. It's ten bucks for a new domain name and saves you a LOT of time.
Thanks! It's a pro-bono thing on a short turn around. I'd rather not donate more than my time but I might have another solution – thanks for your help though!
Ok, then even easier. The other free way to do it is create dev.yoursite.com in DNS and point to that. You don't want to get into DNS, though. If you're pro bono, you don't want to get into more complicated solutions like node creation, though. Another thought would be to create your dev site as a subfolder of your current site, and point to that in Vhosts. It would be viewable, but as long as the main site doesn't have a link to it, the consequences won't be severe. You'd still need a freebie domain name. If it's a flat site with no DB, use the Public folder of a Dropbox. The instructions are all over the web for that one.