Apache server does not show up on EC2 IP - apache

I am trying to install apache2 on my EC2 instance.
I did the following steps:
Launched an Ubuntu 16.4 instance with security group details
http - 80 - anywhere
https - 443 - anywhere
Once I login to my instance I did
sudo apt update
sudo apt install apache2
when I type
service apache2 status
it says that Apache is running
I assumed that after this if I go to my public IP address [xxx.xx.xx.xx] I would see the default apache server page.
But I see This site can't be reached.
The process seems pretty straightforward, what am I doing wrong?

I had this stupid case, it made me reinstall dozens of times.
Maybe my Security groups don't allow https://
Replace https:// with http:// if available.
It will work perfectly.

Related

Gitlab-ee external url is not working

I installed gitlab-ee on my ubuntu 16.04 server hosted with AWS. I am not able to launch gitlab using the external url that is mentioned in gitlab.rb file. I have apache as default webserver. I used a subdomain as external url. But when i launch that url, it is still landing on default apache page and not using nginx to launch gitlab. How to solve this issue?
Apache and Nginx will probably try to use the same ports (80 & 443). The first started, in your case Apache, will start normally, but the second will not initialize properly as two programs can not listen together on the same ports.
Confirm with the command sudo gitlab-ctl status nginx. This will return the status of the integrated nginx instance.
If it is stopped, stop apache and then start nginx using sudo gitlab-ctl start nginx.

Can't Access to my Amazon Instance with public Ip

I have a new amazon instance EC2, and I want to build a Web Server so I did :
Install apache2
Install libapache2-mod-php5
a2enmod rewrite
Add a Http rule in the default group to allow all IP
add Directory AllowOverride All in /etc/apache2/sites-availables/ default-conf
But when I want to check if apache is running by typing the public ip of the instance in my browser, I dont have the basic index.html "it's works". I got nothing.
What does i missed ?
Thanks you.
If apache is running fine, then it might be the firewall.
In the AWS console, make sure you have unblocked port 80 in the "Security Groups" under "Network & Security".
I found the solution.
It was a problem with the firewall.
The security group that I changed was not the one that was linked with my Instance
My bad.
do you know if the apache is running? you can check with:
ps aux |grep -i 'http\|apache'
if it has not started, you can try:
/etc/init.d/httpd start

Setting up multiple sites in Apache

I have the following host file entries on Ubuntu 14 machine running apache
127.0.0.1 localhost
10.20.32.20 library.myDNSname.org
10.20.32.20 library-intra.myDNSname.org
10.20.32.20 mtf
And also
sudo a2ensite library
sudo a2ensite mtf
sudo service apache2 restart
Now when I browse the site.. I can only access library.myDNSname.org page.
But When I
a2dissite library
I can access the mtf site.
Please note both site has been added to the sites-available.
Any Idea how I might run both site on the same server?
Thanks for input
I think it would have been more helpful if you had included your apache sites configuration and also how you are accessing your site (whether by ip or hostname).
If you are accessing your site by an ip then it will just select the default vhost which is the first vhost definition in the configuration file. For more info you can check out Apache's doc.
Please try to access the sites with hostnames and post errors in comments when you tried to access mtf site for the first time.

Starting web server apache2 failed

I have a Virtual Server. Till yesterday everything works fine on it.
Today my Hostcompany restarted my server to config something on I/O.
When I trying to get to my address I get
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
I tried to sudo service apache2 start and get these Error Message:
* Starting web server apache2
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
*
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Does someone know how I can fix this problem?
Stop Nginx service nginx stop
Restart Apache service apache2 restart
You have another webserver that's running on the host (probably as part of the startup during the restart) You need to shut that off first.
You can run netstat -tulpn | grep :80 and that'll tell you what that process is
The problem is this, Nginx (another web server engine) it's using your port 80 so apache it's unable to start, a fast fix it turn of nginx and then restart apache.
You can do it with service nginx stop and service apache2 restart if you are using Ubuntu or Debian based release, if you are using an RHEL distro then use service nginx stop and service httpd restart
Here is my solution
first: sudo update-rc.d -f nginx remove
than: sudo rm /etc/init.d/nginx
after restarting VM almost everything works fine. Some strange thing is almost there.
When I goto www.myfoobarwebpage.com now apache is working and it's all ok!
When I goto myfoobarwebpage.com (without www.) I get "Welcome to nginx! ..."
Try this. My Apache config has 2 extra lines by mistake.
"Include conf/extra/httpd-8080.conf"
"Include conf/extra/httpd-8080.conf"
Therefore, it was saying address already in use because it already loaded the Virtual host once and was trying again.
Solution was to delete this extra line and have only one include.

DNS problem - dig resolves but curl cannot connect to host

I have recently created a Rackspace cloud server instance using CentOS 5.5. I have used yum to install the "Web Server" group (it includes Apache, etc.), added www.booztrakr.com as the ServerName in httpd.conf, made sure iptables allows on port 80. I had registered this domain with Go-Daddy and changed their name servers to the Rackspace name servers on their site. I added "A" and CNAME records to the Rackspace name servers. httpd has been started. When I use curl on the server I can get the Apache landing page. When I dig www.booztrakr.com from a remote machine(over the internet) the answer section returns:
www.booztrakr.com. 300 IN CNAME booztrakr.com.
booztrakr.com. 300 IN A 184.106.216.156
When I try a browser or curl, it can't connect:
curl -G www.booztrakr.com
curl: (7) couldn't connect to host
I know this has got to be pretty basic and config related but I'll be dammed if I can see it. Any help would be appreciated. Thanks.
If dig resolves, this just means the DNS server returns the right values. It will even work if the IP doesn't exists.
If a HTTP connecting to the server fails, this is a configuration problem.
The server responds to ICMP requests, so it's not a routing problem.
When I use curl on the server I can get the Apache landing page
Your webserver is running, but you just can't reach it from outside. This is the problem. What does iptables --list outputs?