I am in the process of learing the LAMP stack and may eventualy go with a GoDaddy Linux hosting account. I would like to develop a web site, deploy it on a server locally and get it going before purchasing hosting at GoDaddy. What would be a good version of Linux to use to simulate deploying and hosting a php/mySQL web site to GoDaddy?

Dani AI

Generated

Good choice making a local mirror before buying hosting. and gave useful distro options and has already grabbed CentOS 5.5 — the most important rule for avoiding surprises is to match the host environment (OS family and the exact Apache/PHP/MySQL versions) as closely as possible. Run that CentOS image inside a VM (VirtualBox/VMware) and take snapshots so you can roll back quickly while you test deployment differences.

Set up a simple LAMP stack and check a few server-level settings you will later find different on shared hosting:

yum install httpd mysql-server php php-mysql -y
service httpd start
service mysqld start
chkconfig httpd on
chkconfig mysqld on
mysql_secure_installation

Verify mod_rewrite, PHP extensions your app needs (mbstring, gd, intl), and php.ini values such as memory_limit, upload_max_filesize and post_max_size. Use phpinfo() to confirm settings and available modules.

Two deployment/workflow tips that often get missed: export/import your database with mysqldump and test filesystem ownership/SELinux which are frequent sources of 403s or write failures on CentOS:

mysqldump -u root -p yourdb > site.sql
mysql -u root -p targetdb < site.sql
chown -R apache:apache /var/www/html/yourapp
# if debugging SELinux only:
setenforce 0
restorecon -R /var/www/html/yourapp

If you want faster iterations, use Docker images that match the distro and PHP/MySQL versions, or use a packaged stack for local dev; but a full VM is better for catching SELinux, init/system differences, and shared-host resource limits. Finally, test email sending, cron jobs, SSL, and error/log handling before going live — those are the usual gotchas when moving from local to a provider.

Recommended Answers

All 4 Replies

For a Linux server I would recommend trying something like Slackware or if you're not too comfortable with the command line I would try the server version of Ubuntu.

Thanks for the link Moncky that is what I was looking for. I decided to download the CentOS 5.5 DVD and will give it a try.

No problems, Its probably worth while dropping them an email and finding out what they would give you (ie version of OS version of http, mysql etc). Its a resonable request and there isnt really any reason that they should decline.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.