lowendbox / lowendscript Goto Github PK
View Code? Open in Web Editor NEWBash scripts to set up/bootstrap low end virtual servers
Bash scripts to set up/bootstrap low end virtual servers
Damn if I know but marrco thinks it's a good idea:
http://www.lowendtalk.com/questions/9060/new-lowendscript-for-php-sites
I guess your script is just for squeeze (php + nginx on dotdeb main repo) so i suggest you to install tmux for 2 reasons:
it's the best terminal multiplexer (and remove screen with your script too)
you can add the newer version via squeeze-backport so you have to add that repo too, and when (if ?) someone studies your script will learn about backports too!
Haven't checked this on your script but LEA's does not set any of the wordpress password salts within wp-config.php. They remain the default.
The correct way to set DASH as the default shell:
dpkg-reconfigure dash
(it does a few other things besides changing the /bin/sh target)
If the login shell is changed to DASH for the normal login user you will also save 1.5 - 1.6% of RAM on a 128 meg box:
chsh -s /bin/dash username
(as it will be open doing nothing while you su to root)
Just noticed that a log directory is created alongside the domain directory.
Shouldn't we be using whatever directory nginx is already using for storing the logs? Is there a way to detect for that?
Plus it's in the /var/www/ directory. Not sure if we want to place those logs where Nginx can access. I would think that would be a security issue.
Tried doing the domain comment line:
bash setup-debian.sh domain cynix.us
And got the following:
Created cynix (OWQ1ZTdmYjc2O) with all permissions on cynix_us
setup-debian.sh: line 512: name: command not found
Reloading nginx configuration: nginx.
Created /var/www/cynix.us, /var/www/log/cynix.us, and /etc/nginx/sites-enabled/cynix.us.conf
The script creates an index.php within root with the following contents:
exec("CREATE TABLE IF NOT EXISTS ( varchar(100)) ENGINE=MyISAM"); $result = $db->query("SHOW TABLES"); while ($row = $result->fetch()) { var_dump($row); }Error produced:
mysqladmin: CREATE DATABASE failed; error: 'Can't create database 'cynix_us'; database exists'
Reloading nginx configuration: nginx: [emerg] open() "/etc/nginx/fastcgi_php" failed (2: No such file or directory) in /etc/nginx/sites-enabled/cynix.us.conf:4
nginx: configuration file /etc/nginx/nginx.conf test failed
invoke-rc.d: initscript nginx, action "reload" failed.
I am referring to this version: https://github.com/Xeoncross/lowendscript but it seems one can't post issues there. Besides issues I also have some simple questions as:
Can you explain this in more detail? First, I added sample MVC framework (everything through index.php) and normal PHP (all php files allowed) configurations to nginx. These allow much cleaner site configs.
Also what exactly is the point of these two files: nginx installed for nginx
Created /etc/nginx/php.mvc.conf and /etc/nginx/php.conf files for PHP sites
To use them "include" them in your /etc/nginx/sites-enabled/[site] config
The nginx part has a fault somewhere: Reloading nginx configuration: [emerg]: open() "/etc/nginx/fastcgi_php" failed (2: No such file or directory) in /etc/nginx/sites-enabled/pacura.ru.conf:4
The point is that in your script you mention a fastcgi_php which I can't find anywhere... but then you do reference it in your nginx vhost files
What command is missing here? I checked your script, line 512 but do not understand what script s missing: root@euve23694:~# bash setup-debian.sh domain pacura.ru
Created pacura (NGY4MzA1N2UxO) with all permissions on pacura_ru
setup-debian.sh: line 512: name: command not found
Your script seems to install wordpress by extracting the latest.zip into the vhosts root but the zip file contains wordpress inside a wordpress folder so the further configuration breaks. Please change it so it unzips without the folder straight into the root: cp: cannot stat `/var/www/pacura.ru/wp-config-sample.php': No such file or directory
sed: can't read /var/www/pacura.ru/wp-config.php: No such file or directory
After trying to fix it partially and getting it to run, I can access the default vhost but none of my test-sites that should use wordpress since it offers me the .php files for download, so it seems nginx isn't processing them but offering them for download. what could be wrong? one test site is http://klub-kamikaze.com give it a try.
Just a suggestion to add a list of the commands to the readme file.
In the Xeoncross fork (https://github.com/Xeoncross/lowendscript/blob/master/setup-debian.sh),
where it is creating the /etc/xinetd.d/dropbear file, you can add these 2 lines to set a different port for ssh than 22:
port = $1
type = unlisted
along with an earlier check for a port passed as an argument:
if [ -z "$1" ]
then
die "Usage: `basename $0` optimize <ssh-port-#>"
fi
and pass that argument from the optimize function to the install_dropbear function:
optimize)
install_dropbear $2
Another way to change the port apparently is to edit the /etc/default/dropbear file.
But I noticed the Keith2 port (https://github.com/Keith2/lowendscript/blob/master/setup-debian.sh )
uses the same method, too (setting port=value and also type=unlisted).
Having this is cool as I'm not a person who likes wordpress. Creating the database is good but let's go ahead and create a new mysql user as well to go along with the db. I know I use this as an extra security step so that if someone gets a hold of a mysqwl user/password combo, they only have access to a single database.
Looks like they moved things around on Debian 6.0:
http://www.codernotes.com/2011/146/nginx-default-root-directory-on-debian-6-squeeze/
See here for reference:
http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/#comment-31328
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.