Setting up Apache on Arch Linux - linux

I can't get apache to run on Arch Linux.
I tried ‍‍‍pacman -S apache => systemctl start httpd => systemctl enable httpd but it didn't work.
help me.

update the system db : sudo pacman -Syu
install apache web server : sudo pacman -S apache
enable apache service : sudo systemctl enable httpd and sudo systemctl restart httpd
get the status of Apache service : sudo systemctl status httpd

Archlinux Wiki has a good material about how to set up Apache on Archlinux, you could check it first:
https://wiki.archlinux.org/title/Apache_HTTP_Server

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

Not able to see GUI using Gnome in RHEL 7.2 deployed in Azure

I am new to Linux environment. I have created a VM in Azure which has RHEL 7.2. I have installed Gnome 3.22.3 in it using Putty. I am NOT able to see the GUI for it. Is it possible to do it? I searched quite a bit, but, didn't find anything concrete. I followed these commands.
1) yum group list
2) a) yum groupinstall 'Server with GUI'
(After downloading)
Is this ok [y/d/N]: y
3) yum groupinstall 'X Window System' 'GNOME'
4) systemctl set-default graphical.target
5) gnome-shell --version
6) Reboot.
Still not able to see the GUI.
I am NOT able to see the GUI for it. Is it possible to do it?
We can install xrdp on your VM, and add port 3389 to NSG inbound rules, then we can use mstsc to RDP it.
sudo -s
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
yum -y install xrdp tigervnc-server
systemctl start xrdp.service
netstat -antup | grep xrdp
systemctl enable xrdp.service
firewall-cmd --permanent --zone=public --add-port=3389/tcp
firewall-cmd --reload
Here a blog about how to enable GUI for centos 7 in classic module, please refer to this link.
Update:
Please follow this steps to install xrdp on your RHEL 7.2:
1.Install Gnome on RHEL 7.2 first:
yum group install "GNOME Desktop" "Graphical Administration Tools"
yum groupinstall "Server with GUI"
ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
reboot
2.Install and configure EPEL repository:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
3.Add nux repository:
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
Or Manual:
vi /etc/yum.repos.d/xrdp.repo
[xrdp]
name=xrdp
baseurl=http://li.nux.ro/download/nux/dextop/el7/x86_64/
enabled=1
gpgcheck=0
4.Install xrdp:
yum -y install xrdp tigervnc-server
systemctl start xrdp.service
Check it with this command:
netstat -antup | grep xrdp
tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN 1784/xrdp-sesman
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 1785/xrdp
Enable the service at system start up:
systemctl enable xrdp.service
Add port 3389:
firewall-cmd --permanent --zone=public --add-port=3389/tcp
firewall-cmd --reload
Configure SELinux:
chcon --type=bin_t /usr/sbin/xrdp
chcon --type=bin_t /usr/sbin/xrdp-sesman
By the way, we should add port 3389 to NSG inbound rules:
Here is my result:

GITLAB installation Challenge on CentOS

I installed GITLAB in CentOS 7.4 in cloud environment, I enabled http, hhtps, ssh ports
When I Open the system, I am getting “Apache HTTP server” welcome page not the GIT LAB page, how to fix this?
Your environment maybe came with httpd installed, GitLab by default uses nginx.
You can stop and disable httpd, then restart GitLab
$ sudo systemctl status httpd
$ sudo systemctl stop httpd
$ sudo systemctl disable httpd
$ sudo gitlab-ctl restart

Jenkins Amazon Linux Setup

I have setup jenkins on my ec2 instance using the below steps from a tutorial online. I am novice in linux environment and deployments. My problem is that the jenkins dashboard is not showing up in browser at <myIp>:8080/jenkins. Can someone help me out for this.
sudo yum install -y docker nginx git
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
sudo vim /etc/nginx/nginx.conf
Change as below
server {
listen 80;
server_name _;
location /jenkins {
proxy_pass http://127.0.0.1:8080;
}
}
sudo usermod -a -G docker jenkins
sudo service docker start
sudo service jenkins start
sudo service nginx start
sudo chkconfig docker on
sudo chkconfig jenkins on
sudo chkconfig nginx on
I had faced similar problem before, you can check following:
Check security groups of the instance for specific ports
Check IP tables on the instance
Hope that helps

How to auto start elasticsearch in Centos 6.5?

I have installed elasticsearh on a server based on Cent OS 6.5. To start it:
# cd /usr/share/elasticsearch/elasticsearch-1.5.2]
# ./bin/elasticsearch &
But when I close the terminal, the process is killed. How can I set it to automatically start as a service?
Try using the "nohup" command with elastic search.
$ nohup ./bin/elasticsearch
Now what the nohup does? In the following example, it starts the program abcd in the background in such a way that the subsequent logout does not stop it.
$ nohup abcd &
$ exit
Hope that helped.
As #DerStoffel said, you have to start elasticsearch as a service (sudo service elasticsearch start). This is highly recommended in production settings. Also add the service to start in case of reboot (sudo /sbin/chkconfig --add elasticsearch)
It depends the distribution of linux you use:
Debian/Ubuntu
sudo update-rc.d elasticsearch defaults 95 10
sudo /etc/init.d/elasticsearch start
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/setup-service.html#_debian_ubuntu
RPM based distributions like Centos
sudo /sbin/chkconfig --add elasticsearch
sudo service elasticsearch start
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/setup-service.html#_rpm_based_distributions
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo /bin/systemctl start elasticsearch.service

Resources