Changes

From Amahi Wiki
Jump to: navigation, search
* Create Apache configuration file (9999 can be changed to any number, but recommend keep it above 2000 to be safe)
<blockquote>{{code|vi /etc/httpd/conf.d/9999-appname.conf}}</blockquote>
::Insert the text below (remember to change all occurrences of appname accordingly and the domain name amahi.net to match yours if needed)
<blockquote>{{text|<VirtualHost *:80>
</VirtualHost>}}</blockquote>
::Change permissions and restart Apache
<blockquote>{{code|chown apache:users /etc/httpd/conf.d/9999-appname.conf
service httpd restart}}</blockquote>
<blockquote>{{code|echo "select max(id) from dns_aliases" <nowiki>|</nowiki> mysql -uroot -phda hda_production
echo "select max(id) from webapps" <nowiki>|</nowiki> mysql -uroot -phda hda_production}}</blockquote>
::Once you have chosen the id number, execute the following
<blockquote>{{code|echo "INSERT INTO `dns_aliases` (`id`, `name`, `address`) VALUES(99, 'appname', '')" <nowiki>|</nowiki> mysql -uroot -phda hda_production
echo "INSERT INTO `webapps` (`id`, `name`, `path`, `kind`, `aliases`, `fname`, `deletable`, `login_required`, `dns_alias_id`, `custom_options`, `created_at`, `updated_at`) VALUES(99, 'appname', '/var/hda/web-apps/appname', '', '', '9999-appname.conf', 0, 0, 99, NULL, '2013-11-17 12:00:00', '2013-11-17 12:00:00')" <nowiki>|</nowiki> mysql -uroot -phda hda_production}}</blockquote>
* Create a test file
<blockquote>{{code|vi /var/hda/web-apps/appname/html/index.html}}</blockquote>
::Insert the text below
<blockquote>{{text|<!DOCTYPE html>
<html>
</body>
</html>}}</blockquote>
::Set the correct permissions on the file
<blockquote>{{code|chown apache:users /var/hda/web-apps/appname/html/index.html}}</blockquote>
* Test your new web app by entering <b><nowiki>http://appname</nowiki></b> in your browser. If all goes well, you should see the test page. If you have problems, retrace your steps. Ensure you replaced all occurrences of appname accordingly and the id field in both tables match.
12,424

edits