How to configure HHVM with Nginx compiled from source? - linux

I installed Nginx 1.8 (compiled from source) on Debian 7:
cd /opt/
sudo wget http://nginx.org/download/nginx-1.8.0.tar.gz
sudo wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz
sudo tar -zxvf nginx-1.8.0.tar.gz
sudo tar -zxzf ngx_cache_purge-2.3.tar.gz
cd /opt/nginx-1.8.0/
sudo ./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-http_ssl_module --with-ipv6 --add-module=/tmp/ngx_cache_purge-2.3
sudo make && make install
sudo adduser --system --no-create-home --disabled-login --disabled-password --group nginx
sudo wget -O init-deb.sh http://www.linode.com/docs/assets/1538-init-deb.sh
sudo mv init-deb.sh /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults
Than I start nginx with the following command:
sudo /etc/init.d/nginx start
And everything works fine until now.
The problem is when I try to install HHVM it doesn't work:
sudo wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
sudo echo deb http://dl.hhvm.com/debian wheezy main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm libgmp-dev libmemcached-dev
sudo update-rc.d hhvm defaults
And when I finally run:
sudo /usr/share/hhvm/install_fastcgi.sh
I get the following error:
Checking if Nginx is installed
Nginx not found
Any thoughts how I can install HHVM with Nginx compiled from source?

You're going to have to read the script and apply its patch manually. It's hardcoded to work with the distro-supplied nginx, and assumes that it's installed in that location -- since the deb we provide for Debian sticks a particular script in the nginx system configuration anyways. Your manually built nginx is in a different location; the script would have no way of knowing where to find it!
Here's the source for the install_fastcgi.sh -- the relevant bit is that it inserts a line after server_name to include hhvm.conf. You can find that hhvm.conf either here or it's probably already on your system at /etc/nginx/hhvm.conf.
BTW, the script really isn't that complicated. In general, a good way to figure out why something broke is to skim through it and see what it's doing :)

Related

Setting wordpress in a VM with ubuntu

Some time ago a friend of mine configured me a VM Ubuntu built to allow me construct a Wordpress site through SSH... given some technical issues I had to delete the VM and Im trying to remake one, I already know how to set the wordpress through SSH but not how to configure the VM so It can LET me do it (I tried making one but it doesnt have the same folders like WWW inside /var)
I guess you're trying to deploy wordpress on a LAMP stack.
There are some prerequisites:
open your terminal and
run this commands to install the server:
sudo apt-get update && apt-get upgrade
​sudo apt-get install lamp-server^
run this commands to install php:
sudo apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-cli php7.0-cgi php7.0-gd
Then you have to create a database like this:
CREATE DATABASE wpdb;
​GRANT ALL PRIVILEGES ON wpdb.* TO 'USERNAME'#'localhost' IDENTIFIED BY 'ADMIN_PASSWORD';
​FLUSH PRIVILEGES;
​EXIT;
and finally get and install wordpress:
wget -c http://wordpress.org/latest.tar.gz
​​tar -xzvf latest.tar.gz
sudo mv wordpress /var/www/html
sudo chown -R www-data:www-data /var/www/html/wordpress
​ sudo chmod -R 755 /var/www/html/wordpress
and rename the config file
cd /var/www/html/wordpress
​ sudo mv wp-config-sample.php wp-config.php
restart the server:
sudo systemctl restart apache2.service
​ sudo systemctl restart mysql.service
and voila', wordpress is ready to be served

Installing MySQL on CentOS using shell script

I am writing a script where I should install MySQL on my Centos hard disk when I run it.
I downloaded the following :
mysql-apt-config_0.8.5-1_all.deb
But I don't figure out how to install it from the shell script.
I am new to Linux and any help is appreciated !!
Since Centos is yum package manager just run the following commands to install MySql
If you are using Centos 7, you need to first add the repository as follows
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum update
To install MySql on Centos, we run
sudo yum install mysql-server
sudo systemctl start mysqld
Note: .deb files are only used for Debian based Linux Distros. Centos uses .rpm files.
Try to save following command in a shell file(extension with .sh) and run with sudo.
#!/bin/bash**strong text**
export http_proxy= $Write proxy
export https_proxy= $ write proxy
sudo -E yum -y update
sudo -E yum -y install wget
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
sudo -E yum -y update
sudo -E yum -y install mysql-server
sudo systemctl start mysqld
sleep 1s
mysql -u root <<-EOF
UPDATE mysql.user SET Password=PASSWORD('123') WHERE User='root';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.db WHERE Db='test' OR Db='test_%';
FLUSH PRIVILEGES;
EOF

CouchDB: Unable to start CouchDB normally

I am a newbie to couchDB. Recently, I have dived into it with a quick installation instruction over here:
sudo apt-get update -y
sudo apt-get install g++ -y
sudo apt-get install erlang-base erlang-dev erlang-eunit erlang-nox -y
sudo apt-get install libmozjs185-dev libicu-dev libcurl4-gnutls-dev libtool -y
curl -O http://apache.mirrors.tds.net/couchdb/source/1.5.1/apache-couchdb-1.5.1.tar.gz
tar -zxvf apache-couchdb-1.5.1.tar.gz
cd apache-couchdb-1.5.1
./configure
make
sudo make install
sudo adduser --disabled-login --disabled-password --no-create-home couchdb
sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/run/couchdb
sudo ln -s /usr/local/etc/logrotate.d/couchdb /etc/logrotate.d/couchdb
sudo ln -s /usr/local/etc/init.d/couchdb /etc/init.d
sudo update-rc.d couchdb defaults
1. modify /usr/local/etc/couchdb/local.ini
2. change bindAddress to 0.0.0.0
3. reboot
4. remember to go into the config settings and secure server
5. remember to turn on auto compaction
I have followed exactly the guide, except the 4th and 5th steps cause I did not know how to do it. When I ran:
couchdb
I got the following message in the terminal (I am using Ubuntu 14.04 LTS):
Apache CouchDB 1.5.1 (LogLevel=info) is starting.
Error opening log file /usr/local/var/log/couchdb/couch.log: permission denied{"init terminating in do_boot",{{badmatch,{error,{bad_return,{{couch_app,start,[normal,["/usr/local/etc/couchdb/default.ini","/usr/local/etc/couchdb/local.ini"]]},{'EXIT',{{badmatch,{error,{shutdown,{failed_to_start_child,couch_primary_services,{shutdown,{failed_to_start_child,couch_log,{error,"permission denied","/usr/local/var/log/couchdb/couch.log"}}}}}}},[{couch_server_sup,start_server,1,[{file,"couch_server_sup.erl"},{line,98}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,269}]}]}}}}}},[{couch,start,0,[{file,"couch.erl"},{line,18}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
May anyone help me figure out this problem and suggest some solution to fix it? Thank you very much.
You may need to start the couchdb process as the couchdb user, with su couchdb -c ./couchdb (assuming the current directory contains the executable) - double-check the su command options for your system.
Also, check the permissions on /usr/local/var/log/couchdb/couch.log - make sure it is writeable by the couchdb user.
I would like to make a note here for how I fixed this problem in my environment. In my case, the /opt/couchdb/data folder was a symlink to /var/lib/couchdb. No matter what I tried I would get a permission denied error at startup, even though all the files seemed to be owned by user couchdb.
I eventually figured out that the "execute" permission was not set on /var/lib. Without this permission the symlink would not work. If you run into this problem, start by setting chmod -R a+x /var as I did, to prevent this from happening.
Although on CentOS, the "problem" is avoided using service couchdb [start|status|stop|restart].
https://medium.com/#tomiwatech_45998/installing-couchdb-on-ubuntu-17-10-18148e2eb846
Hi there,
this helped me resolve the issue and solved the problem. My ubuntu version is 16.04 and i downloaded couchdb-1.7.0 version.
You can start couchdb using below command
sudo couchdb stop
sudo couchdb start

Not able to install youtube-dl

I have tried almost everything I could find on google but could not install youtube-dl on Debian Mint.
Try 1
Installed and updated with following commands:
sudo apt-get install youtube-dl
sudo youtube-dl -U
But when tried
youtube-dl http://www.youtube.com/watch?v=dwYatpwrs8s
Then I got
Hi! We changed distribution method and now youtube-dl needs to update itself one more time.
This will only happen once. Simply press enter to go on. Sorry for the trouble!
From now on, get the binaries from http://rg3.github.io/youtube-dl/download.html, not from the git repository.
Then I went to http://rg3.github.io/youtube-dl/download.html and followed the installation instructions:
Try 2
sudo wget http://youtube-dl.org/downloads/2013.05.23/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl
Got the same error about the distribution change and new link.
Try 3
So I installed pip on my debian first and ran
sudo pip install --upgrade youtube_dl
But I am still getting same error and I have no idea what to do about it.
Just re-execute sudo youtube-dl -U and press Enter to update to the latest version. With your second try, you installed it a second time (to /usr/local/bin/ instead of /usr/bin) - you want only one.
Alternatively, simply uninstall youtube-dl with sudo apt-get remove -y youtube-dl. That should make the local version (/usr/local/bin/youtube-dl) the first one in your PATH again - if your PATH contains /usr/local/bin. If it doesn't, you can also just install youtube-dl to /usr/bin, with the following commands:
sudo wget https://yt-dl.org/latest/youtube-dl -O /usr/bin/youtube-dl
sudo chmod a+x /usr/bin/youtube-dl
If you already install remove it:
sudo rm /usr/bin/youtube-dl
sudo apt-get remove -y youtube-dl
Try the following command
sudo wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl
hash -r
I solved the issue with this:
https://github.com/ytdl-org/youtube-dl/issues/3908
Use the following commands to update:
sudo rm /usr/bin/youtube-dl # or apt-get remove -y youtube-dl
sudo wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl

Install Icecast into Linux

I have no experience to linux system, and i would like to help me to solve this issue..
Now i have the following job..
cd ~
cd home
cd myusernmae
mkdir src
wget http://downloads.xiph.org/releases/icecast/icecast-2.3.2.tar.gz
tar -zxvf icecast-2.3.2.tar.gz
cd icecast-2.3.2
./configure
Error so i type the followings
apt-get install libxslt1-dev
sudo apt-get install libogg-dev libvorbis-dev
./configure
make
make install
cp -R /home/username/icecast-2.3.2/web ~/icecast/
Now when i type icecast shell response with the following message
Icecast 2.3.2
usage: icecast [-b -v] -c <file>
options:
-c <file> Specify configuration file
-v Display version info
-b Run icecast in the background
I know how can i use icecast into windows (icecast configuration file) but i don't know where to find it and how modify it into linux (vi editor :( )
Any help would me usefull
If this is an Ubuntu or a Debian based system, a simple sudo apt-get install icecast2 should install the server for you without polluting your system. The configuration file is usually in /etc/. If it is Debian or Ubuntu, doing a dpkg -L icecast2 | grep etc after installing should show you the config files. Fire up an editor, edit them and then restart the service.

Resources