AMAZON AWS STARTUP ROUTINE
yum update -y
yum install -y nano mlocate wget screen
chkconfig iptables off
service iptables stop
*********** commands to enable root and set
password
sudo perl -i -pe 's/disable_root:
1/disable_root: 0/' /etc/cloud/cloud.cfg
sudo perl -i -pe 's/#PermitRootLogin
.*/PermitRootLogin without-password/' /etc/ssh/sshd_config
sudo perl -i -pe 's/.*(ssh-rsa .*)/\1/'
/root/.ssh/authorized_keys
sudo /etc/init.d/sshd reload
sudo passwd root
*********** commands to install webmin
cat > /etc/yum.repos.d/webmin.repo <<
EOF
[Webmin]
name=Webmin Distribution Neutral
enabled=1
EOF
yum install -y webmin
*********** commands to create swap file
dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
mkswap /var/swap.1
swapon /var/swap.1
# use webmin to modify the /etc/fstab file and
add the following line:
echo "/var/swap.1
swap swap
defaults 0 0" >>
/etc/fstab
*********** set hostname
edit /etc/sysconfig/network
edit /etc/hosts
run hostname
restart networking /etc/init.d/network restart
- Download Lighttpd
- Download PHP
- gzip
-dc lighttpd-1.3.14.tar.gz | tar xf -
- cd
lighttpd-1.3.14
- ./configure
--prefix=/opt/lighttpd
- make
all install
- cp
doc/lighttpd.conf /etc/
- cd ..
- gzip
-dc php-5.0.4.tar.gz | tar xf -
- cd
php-5.0.4
- ./configure
--enable-fastcgi --with-mysql=<path to MySQL installation>
--prefix=/opt/php-fcgi
- make
all install
- Edit
/etc/lighttpd.conf as appropriate. You will need to add at least the
following lines:
fastcgi.server = ( ".php" =>
(
"localhost" =>
(
"host" => "127.0.0.1",
"port" => 1026,
"bin-path" => "/opt/php-fcgi/bin/php-cgi"
)
)
)
url.rewrite-once = (
"^/wiki/upload/(.+)" => "/wiki/upload/$1",
"^/$" => "/w/index.php",
"^/wiki/([^?]*)(?:\?(.*))?" =>
"/w/index.php?title=$1&$2"
)
If you use the
static-file module, it will try to cache everything it can... including the PHP
modules that are supposed to be executed instead. So in many
cases you'll also need to add:
static-file.exclude-extensions = ( ".php", ".pl",
".fcgi" )
or at least:
static-file.exclude-extensions = ( ".php" )
And if you also want
to support "http://yoursite/ArticleName" URLs:
url.redirect = (
"^/(?!w|wiki|robots\.txt|favicon\.ico)(.*)" =>
"/wiki/$1" )
Ensure the
"rewrite", "redirect" and "fastcgi" modules are
enabled.
- Extract
the MediaWiki source into your document root, and mv
mediawiki-1.5beta1 w
- Start
lighttpd: /opt/lighttpd/sbin/lighttpd -f /etc/lighttpd.conf
- Visit "http://www.yoursite.com/w/config/index.php" and
configure MediaWiki as documented at Manual:Installation guide
- Edit
LocalSettings.php and change $wgArticlePath to:
$wgArticlePath = "/wiki/$1";
NOW INSTALL MYSQL
yum install mysql-server mysql
Start MySQL and
secure it
service mysqld start
mysql_secure_installation
Create a new database
and wiki user to avoid using the root user:
mysql -u root -p
CREATE DATABASE
database name;
For example only:
CREATE DATABASE
wikidatabase;
To view if it was
created:
SHOW DATABASES;
Grant privileges:
GRANT ALL PRIVILEGES
ON *.* TO 'wiki'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED' WITH
GRANT OPTION;
exit
For example only:
GRANT ALL PRIVILEGES
ON wikidatabase.* TO 'wikiuser'@'localhost' IDENTIFIED BY 'Pippo123456?' WITH
GRANT OPTION;
exit
Remember the 'wiki'
password for MySQL that you create here. You will need it when setting up the
wiki database. You can test it with:
mysql -u wiki -p
SHOW GRANTS;
Make sure MySQL
starts on boot
chkconfig mysqld on
RESTART THE SERVICES
Sudo service lighttpd restart
Sudo service mysql restart