I recently purchased a linode.com VPS.
It took about 3 minutes to set it up..
The problem is that it came with a barebones ubuntu install, everything needed to be installed from the ground up.
Luckily I took note of the entire installation procedure and compiled it into a Shell Script. Running the script I can have a linode virtual server up in less then 5 minutes and it is ready for drupal.
It installs the following:
Apache2
PHP5
Mysql
mysqladmin
vsftp = for FTP server
configures:
mod_rewrite
ssl
curl
gd
FTP server
creates the necessary configuration "*.conf" files for you domain name.
Prompts you to enter a domain you want to host.
apt-get update
apt-get install apache2
/etc/init.d/apache2 start
apt-get install php5 libapache2-mod-php5
apt-get install php5-curl
apt-get install php5-gd
apt-get install mysql-server
apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
apt-get install vsftpd
a2enmod rewrite
/etc/init.d/apache2 force-reload
a2enmod ssl
/etc/init.d/apache2 force-reload
sed -ie 's/anonymous_enable=YES/anonymous_enable=NO/' /etc/vsftpd.conf
sed -ie 's/#local_enable/local_enable/' /etc/vsftpd.conf
sed -ie 's/#write_enable/write_enable/' /etc/vsftpd.conf
sed -ie 's/#local_umask=022/local_umask=000/' /etc/vsftpd.conf
/etc/init.d/vsftpd restart
echo Enter a name for you site:
read site_name
echo $site_name
mkdir /var/www/$site_name
chmod 777 /var/www/$site_name
mkdir /var/www/www.$site_name
chmod 777 /var/www/www.$site_name
function create_v_host () {
echo "<VirtualHost *>" >> file
echo "ServerName $1" >> file
echo "DocumentRoot /var/www/$1" >> file
echo "</VirtualHost>" >> file
echo "<Directory /var/www/$1>" >> file
echo "AllowOverride All" >> file
echo "Allow from all" >> file
echo "</Directory>" >> file
}
function create_v_host_ssl () {
echo "<VirtualHost *:443>" >> file
echo "SSLEngine On" >> file
echo "SSLCertificateFile /etc/apache2/ssl/apache.pem" >> file
echo "ServerName $1" >> file
echo "DocumentRoot /var/www/$1" >> file
echo "</VirtualHost>" >> file
echo "<Directory /var/www/$1>" >> file
echo "AllowOverride All" >> file
echo "Allow from all" >> file
echo "</Directory>" >> file
}
echo "#NameVirtualHost *" >> file
echo "#NameVirtualHost *" >> file
create_v_host $site_name
create_v_host "www.$site_name"
mv file /etc/apache2/conf.d/$site_name.conf
/etc/init.d/apache2 restart
create_v_host_ssl $site_name
create_v_host "www.$site_name"
mv file /etc/apache2/conf.d/$site_name.conf.ssl
There are two things not specified in the script
1. creating a local user for the ftp. just
$ adduser username
$ usermod -d /var/www username #sets the webserver as the user's local directory
2. install ssl cert
One last thing.
The barebones does not have anyway of uploading the script or retrieving it. So unless you want to type the whole thing in a text editor i recommend you
1. copy & paste the script to a file on your local machine, say script.txt
2. place in a publicly accessible server.
3. run
$ apt-get install wget
$ wget http://url/of/your/file/script.txt
$ mv script.txt script.sh
$ chmod 777 script.sh
4. run it
./shellscript.sh
oh, and you need to be logged in as "root"
You are now ready to upload your drupal installation.
1. create a database with myphpadmin
2. upload a drupal install via FTP
3. run the install
the location of your server files is at /var/www/domain.com and /var/www/www.domain.com
you can decide which ones you want
Comments
ftp
Thank you for posting this.
I signed up for linode and may be a in a bit over my head but I learning...
I ran the script successfully but now am having trouble logging in to ftp. I assumed I could log in as anonymous at my ip address. I wasn't sure If the path mattered so I tried www and var/www ass well as the root directory. Do you know what I'm doing wrong?
ftp issue resolved now I have another problem
I logged in to ftp as "user" with password. It works!
when I go to www.mysite.com I get redirected to: www.mysite.com/install.php and get the following message:
Warning: require_once(./modules/system/system.install) [function.require-once]: failed to open stream: No such file or directory in /var/www/www.pichasafari.com/install.php on line 26
Fatal error: require_once() [function.require]: Failed opening required './modules/system/system.install' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/www.pichasafari.com/install.php on line 26
you probably
you probably haven't completely uploaded your entire site.
to verify, see if the file in question astually exists on your site.
in this case /var/www/www.pichasafari.com/modules/system/system.install
if it doesn't exist you have to upload it and the rest of the the installation folder.
apt-get dist-upgrade
One thing you may want to do after apt-get update is apt-get dist-upgrade to get the most recent stable versions of core packages.
New Problems
I can't access phpMyAdmin when I go to www.domain.com/phpMyAdmin I get redirected to the home page.
Also even though I copied the settings file and granted permision I still get:
The Drupal installer requires that you create a settings file as part of the installation process.
1. Copy the ./sites/default/default.settings.php file to ./sites/default/settings.php.
2. Change file permissions so that it is writable by the web server. If you are unsure how to grant file permissions, please consult the on-line handbook.
When I try to try to "choose my language".
How did you run everything at
How did you run everything at once? I'm using Putty and I can't copy and paste it.
Last part of article
Last part of article explains that you should create pre-create a text file, upload it somewhere, and download it using "wget"
Adding a Second Domain
Everything worked great for my first domain!
So..I then tried to add a second domain. I followed the instructions provided at http://library.linode.com/lamp-guides/ubuntu-11.04-natty, but when I browse to www.myseconddomain.com, it brings up www.myfirstdomain.com.
Is there something in this script that is possibly conflicting with adding another VirtualHost? Maybe something needs to be added to my /etc/hosts file? I dunno. I'd appreciate any help!
Thanks!