Setting wordpress in a VM with ubuntu - azure

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

Related

Publish Asp.net Core 3.1 Web Api on Azure Linux Ubuntu 18.04 VM

I am trying to publish the application on Azure Linux Ubuntu 18.04 VM. i configure step mention below step on VM but i am facing 404 url Not Found issue.
The requested URL was not found on this server.
Apache/2.4.29 (Ubuntu) Server at myipaddress Port 80 error
I have only simple WeatheForeCast web api controller which is default in asp.net core web api 3.1
I have followed below commands by connecting VM
sudo -i
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
sudo apt-get install aspnetcore-runtime-3.1
sudo apt-get install dotnet-runtime-3.1
sudo apt-get install apache2
systemctl restart apache2
a2enmod proxy proxy_http proxy_html proxy_wstunnel
sudo a2enmod rewrite
vi /etc/apache2/conf-enabled/webapplication4.conf
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/
ErrorLog /var/log/apache2/webapplication4-error.log
CustomLog /var/log/apache2/webapplication4-access.log common
</VirtualHost>
cat /etc/apache2/conf-enabled/webapplication4.conf
vi /etc/apache2/conf-enabled/webapplication4.conf
cat /etc/apache2/conf-enabled/webapplication4.conf
systemctl restart apache2
sudo chmod 777 /etc/apache2/conf-enabled/webapplication4.conf
cd /var/
mkdir WebApi
cd WebApi
i have published webapi with folder option
With netcoreapp3.0 as Target Framework and Framework-Dependent as Deployment Mode
Selected linux-x64 as Target Runtime, as we want to host our application in Linux environment
and tranfer file using winscp software and Copied file using below command
cp -R * /var/WebApi/
vi /etc/systemd/system/kestrel-webapplication4.service
[Unit]
Description=Aspnet Core Web Api running on Ubuntu 18.04
[Service]
WorkingDirectory=/var/WebApi
ExecStart=/usr/bin/dotnet /var/WebApi/webapplication4.dll
Restart=always
RestartSec=10
SyslogIdentifier=dotnet-demo
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target
sudo systemctl enable /etc/systemd/system/kestrel-webapplication4.service
sudo systemctl start kestrel-webapplication4.service
http://MyIpaddress/WeatherForeCast it shows 404 url not found. Apache/2.4.29 (Ubuntu) Server at MyIpaddress Port 80

How to uninstall gitlab from local ubuntu 14.04 server

Can you please help me to uninstall gitlab. i deleted the /home/gitlab but it still open up when i browse to my hostname.
Thank you.
This worked on ubuntu 16.04
sudo apt-get remove gitlab-ce
sudo rm -rf /var/opt/gitlab
--kill all process live
sudo pkill -f gitlab
-- Remove paths
sudo rm -rf /opt/gitlab
sudo rm -rf /etc/gitlab
rm -rf /var/opt/gitlab
Stop the gitlab service. Try doing.
sudo apt-get remove gitlab-ce
Then remove gitlab files from the system. Some files are in /etc directory.
Have a look at the official documentation.
uninstall Gitlab:
1- Stop the gitlab service
Command : sudo gitlab-ctl stop
2- Start commonde of service facility
command : sudo gitlab-ctl uninstall
3- Delete the package of gitlab
command : Locat gitlab
4- restart machine

How to configure HHVM with Nginx compiled from source?

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 :)

How to Install Gitlab on Centos 6.6 VPS?

I tried installing as mentioned here: https://about.gitlab.com/downloads/
sudo yum install openssh-server
sudo yum install postfix
sudo yum install cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
curl -O https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.7.2_omnibus.5.4.2.ci-1.el6.x86_64.rpm
sudo rpm -i gitlab-7.7.2_omnibus.5.4.2.ci-1.el6.x86_64.rpm
sudo gitlab-ctl reconfigure
It looks like everything went successfully, but but I don't get anything on my hostname. Is there anything I missed?
GitLab will try to setup the FQDN by using the hostname of your machine. To do this manually, open /etc/gitlab/gitlab.rb and edit the external url according to the documentation, which by the way if you haven't already read, I suggest that you do it!

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

Resources