• 3rd, Apr 2011

Amazon EC2 SUSE Linux Enterprise Server for Magento

These are the steps that I’ve followed to create an instance of Suse Linux Enterprise for a Magento store on Amazon EC2

EC2 SUSE Linux Enterprise Server 11 32-bit SP1
- MySQL 5.0.67
- Apache 2.2.16
- OpenSSL 0.9.8h
- PHP 5.3.3

Getting ready to run Magento 1.4 with two websites and multiple stores.
domain a > magento website1 / store1
domain b > magento website1 / store2
domain c > magento website2 / store3

1) Add the next repositories in YaST > Software > Software Repositories
** Apparently openSUSE_11.1 is not available any more. Try with openSUSE_11.3 repository instead **
a) Apache – http://download.opensuse.org/repositories/Apache/openSUSE_11.3/
b) Apache Modules – http://download.opensuse.org/repositories/Apache:/Modules/Apache_openSUSE_11.3/
c) Apache PHP Modules – http://download.opensuse.org/repositories/server:/php/openSUSE_11.3/
(Thanks to Opensuse.org! http://en.opensuse.org/Additional_package_repositories)
(image1)

2) Install the next packages from YaST > Software > Software Management
Packages installed:
php5
php5-bz2
php5-calendar
php5-ctype
php5-curl
php5-devel
php5-dom
php5-exif
php5-fileinfo
php5-ftp
php5-gd
php5-gettext
php5-gmp
php5-hash
php5-iconv
php5-json
php5-ldap
php5-mbstring
php-mcrypt
php5-mysql
php5-openssl
php5-pdo
php5-pear
php5-phar
php5-shmop
php5-soap
php5-sockets
php5-sqlite
php5-tokenizer
php5-wddx
php5-xmlreader
php5-xmlrpc
php5-xmlwriter
php5-xsl
php5-zip
php5-zlib

apache2
apache-devel
apache2-prefork
apache2-utils
apache2-mod_php5
apache2-mod_security
apache2-mod_stats
apache2-mod_telemetry

mysql
mysql-client

logwatch

3) Setting up mod_security
# mkdir /srv/www/logs

4) Setting up Apache, Mysql and PHP5
Apache2_PHP5_Standard_Config.zip

# vi /etc/sysconfig/apache2
[...]
APACHE_MODULES=”actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir php5 rewrite status security deflate”
# If you need SSL activate this flag
APACHE_SERVER_FLAGS=”-D SSL”
[...]

# vi /etc/php5/apache2/php.ini
[...]
short_open_tag = On
[...]
date.timezone = “Europe/London”
date.timezone = “America/Bogota”
[...]

3) Install PHP APC Cache
pecl install channel://pecl.php.net/apc-3.1.4

4) Extra Software Needed (if needed)
# YaST
lynx
vsftpd

#vi /etc/vsftpd.conf
anonymous_enable=NO
# Amazon Firewall Ports Open
pasv_max_port=30000
pasv_min_port=30100
pam_service_name=vsftpd
#userlist_enable=YES
tcp_wrappers=NO
pasv_enable=YES
port_enable=YES
# Log everything
log_ftp_protocol=NO
# Block the users to Home Folder
chroot_local_user=YES

5) Date and Time
YaST > System > Date and Time

6) Automatic Startup Services
# chmod 755 /etc/init.d/mysql
# chkconfig –add mysql
# chkconfig –level 35 mysql on

# chmod 755 /etc/init.d/apache2
# chkconfig –add apache2
# chkconfig –level 35 apache2 on

At this point is the AMI Image “Suse11S1 v2 UnexpectedIT”
Apache 2.2.16
PHP Version 5.3.4-dev
APC 3.1.4
MySQL 5.0.67

# mysql_secure_installation

# vi /etc/aliases
[...]
root: handpicked@richardmason.net
[...]

# vi /etc/postfix/main.cf
myhostname = ec2-12-34-567-89.eu-west-1.compute.amazonaws.com
smtp_generic_maps = hash:/etc/postfix/generic

# vi /etc/postfix/generic
wwwrun@ec2-12-34-567-89.eu-west-1.compute.amazonaws.com no-reply@yourdomain.com

# postmap /etc/postfix/generic

# /etc/init.d/postfix restart

2 domains
2 different SSL Certificates

# vi /etc/apache2/listen.conf
NameVirtualHost ec2-xx-xx-xxx-xxx.eu-west-1.compute.amazonaws.com:80

# vi vhosts.d/vhost.conf
[...]

ServerAdmin server-admin@unexpectedit.com
DocumentRoot /srv/www/htdocs/ipascual.com/
ServerName www.unexpectedit.com
ServerAlias www.ipascual.com

Options -Indexes FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all


[...]

TAGS: None

Leave a Reply

*

© 2010 unexpected[it]. All Rights Reserved.