Post #: 99
Post type: Blog post
Date: 2014-02-14 00:27:18.000
Author: Rocket Man
I've been setting up a lot of new sites lately using newLISP on Rockets. Here's the process for making a brand new site from scratch.
This assumes you've already got Linux and Apache installed on the server. This is easy to do with Ubuntu Server-- just select "LAMP" at install time. All these instructions are for Ubuntu but they should work on other Debian-based Linuxes.
Your web directory should be in /var/www.
1. Install newLISP
* Download newLISP Debian package by going to newlisp.org, finding the most recent newLISP .deb package, and typing
wget url-of-most-recent-newLISP-package
NOTE: This is the 32-bit version of newLISP. If you want the 64-bit version, you will need to compile it yourself, or get one of the unsupported 64-bit Debian installers (do a Google search for the most recent version). Also, the version numbers may change in the future-- go to the Downloads page at newlisp.org to get the current version.
Then install it using the following command:
sudo dpkg -i newlisp_10.5.4-1_i386.deb
2. Install SQLite
SQLite is the database used for all permanent storage in newLISP on Rockets. To install it, type:
sudo apt-get install sqlite3
3. (OPTIONAL) Set up a new site in /etc/apache2/sites-available
NOTE: This step is only if you want multiple websites (multiple URLs) on your Ubuntu install. If you don't need this, you still have to edit your /etc/apache2/sites-available/default file and add "+ExecCGI" to the Options line under <Directory /var/www/>
Add a new site file, in this case we're calling it "starscene.net" which is the URL of the new site. Make it look something like this:
<VirtualHost *:80>
ServerAdmin starman@starscene.net
ServerName starscene.net
ServerAlias www.starscene.net
DocumentRoot /var/www/starscene
<Directory />
Options FollowSymLinks +ExecCGI
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +ExecCGI
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
4. (OPTIONAL) Make a new subdirectory in your web root and enable the site, edit permissions
NOTE: Again, this step is only if you are creating multiple sites on your Ubuntu server. If you have just one site, you can skip this step.
enable site sudo a2ensite sitename.com
cd /var/www
mkdir sitename
sudo chown www-data sitename
5. Get newLISP on Rockets
cd /var/www/sitename (if you have only one site, type "cd /var/www" instead to go to the root directory of your web server)
sudo wget
https://github.com/newlisponrockets/newLISP-on-Rockets/archive/master.zipsudo unzip master.zip (if you get a message about unzip not installed, just type "sudo apt-get install unzip" first)
cd newLISP-on-Rockets-master
sudo cp -R * ..
6. Fix the crypto library!
Unfortunately, the library libcrypto.so is always changing version numbers, and newLISP often doesn't know where to find it. So you have to find it yourself.
cd /
sudo find . name libcrypto*
You should get something back like "./lib/i386-linux-gnu/libcrypto.so.1.0.0"
Now, you have to tell newLISP where to find this cryptic cryptography file:
cd /usr/share/newlisp/modules
sudo nano crypto.lsp
Page down a couple of times to get to the long list of places to find the library, and add "/lib/i386-linux-gnu/libcrypto.so.1.0.0" or whatever you found from before to the end of this list.
Some day, I'm going to write a script to do this automatically.
7. Run the setup script
cd /var/www (or cd /var/www/sitename if you've set up multiple sites)
sudo newlisp setup-rockets.lisp
sudo chown www-data *.db
If it works, it will ask you for some names and email addresses and such, and then spit out a list that is the first entry in the new database for Rockets, ending in "nil nil)". Don't worry about those nils. They are good nils.
8. Get Bootstrap
NOTE: Rockets uses an older version of Bootstrap. I'm working on updating it to work with the newer version, but for now, use the following tools to grab the CSS
cd /var/www (or cd /var/www/sitename if you've set up multiple sites)
sudo mkdir css
cd css
sudo wget
http://newlisponrockets.com/css/bootstrap.csssudo wget
http://newlisponrockets.com/css/bootstrap-responsive.csssudo wget
http://newlisponrockets.com/css/datepicker.csssudo wget
http://newlisponrockets.com/css/docs.csscd ..
sudo mkdir js
cd js
sudo wget
http://newlisponrockets.com/js/jquery-1.8.2.min.jssudo wget
http://newlisponrockets.com/js/bootstrap.min.jssudo wget
http://newlisponrockets.com/js/bootstrap-datepicker.js9. Get images!
cd /var/www (or cd /var/www/sitename if you've set up multiple sites)
sudo mkdir images
cd images
sudo wget
http://newlisponrockets.com/images/poweredby.pngsudo wget
http://newlisponrockets.com/images/newlisp-rockets-picture.jpgsudo wget
http://newlisponrockets.com/images/new-icon.jpgsudo wget
http://newlisponrockets.com/images/newlisp-rockets-picture-small.jpgsudo mkdir avatars
cd avatars
sudo wget
http://newlisponrockets.com/images/avatars/unknown.pngAnd you should be good to go! Set your DNS to point to the IP of your web server, and Apache will automatically redirect any links to the site to the sub-directory and run index.cgi, which loads Rockets and redirects to rockets-main.lsp, the main page.
Troubleshooting!!!
I get a 'crypto library not found' error!
You have to find the libcrypto library and add it to /usr/share/newlisp/modules.crypto.lsp (See the detailed description above)
Apache just shows the text of the newlisp script, instead of executing it!
You could try adding the line:
AddHandler cgi-script .cgi .lsp
To /etc/apache2/sites-available/default (or instead of default, your site name)
If things really don't want to execute, try this:
cd /var/www
sudo nano .htaccess
Add the line "Options +ExecCGI"
It works, but I can't write to the database (I can't make any new posts)
Make sure you've set the permissions on DATABASENAME.db (whatever name you gave it at the start). Usually chown www-data *.db works. You may also have to go to /var and type chown www-data www to give permission to the web server to create new files in that directory.
It works, but the front page still shows the "It works but no content has been added yet" page, I have to go to rockets-main.lsp manually
Sometimes the default index.cgi won't execute if you have PHP installed, or if you have index.html already in /var/www. Delete /var/www/index.html and, if necessary, create a new file called index.php that has the following lines:
<?php
echo('Hello');
header( 'Location: rockets-main.lsp' );
?>
This will redirect the front page of the site to the first page of Rockets.
Any other issues? Post a reply to this thread and I'll try to answer them!
View this post in the forums
Views: 29128