Ubuntu LAMP Virtual Host - Apache 500 Internal Error - apache

I create a virtual host using virtualhost.sh script (you can find it easily on GitHub), and mapped it to the root of my project folder (Yii2 Project), when I visit my virtual host, I got Apache 500 Internal Error.
Ubuntu LAMP
Thanks

The problem was in the rewrite module wasn't enabled by default when you install LAMP manually, and the .htaccess file in the root directory uses RewriteEngine...
Enable rewrite module:
sudo a2enmod rewrite
Then, you need to restart your Apache:
sudo service apache2 restart
Done.

Related

AWS Route 53 point domain to directory

I am working with AWS ubuntu 16.04 and apache webserver. My root folder is /var/www/html. I need to point my primary domain to project folder /var/www/html/store.
How is it possible..??
Just edit you Apache config (usually something like /etc/httpd/httpd.conf or /etc/apache/httpd.conf) and restart apache (usually service httpd restart or service apache2 restart).

Unable to find httpd directory in Amazon EC2 to configure PhpMyAdmin

I am new to amazon servers. I have Installed PhpMyadmin in my Amazon EC2 server. To access my server's PhpMyadmin from my PC it seems I need to configure some files. According to this link I need to change the file /etc/httpd/conf.d/phpMyAdmin.conf But there's no directory or file named 'httpd' in /etc directory. Where can I find the httpd directory? How can I configure my machine to access phpmyadmin? I almost tried every solution in stackoverflow and none of them worked for me. Any help is appreciable.
First you need to configure web-server on your ec2 instance. You can install apache as a webserver.
For RHEL/Amazon/Fedora Distro issue following commands:-
sudo yum install httpd
Then make changes in /etc/httpd/conf.d/phpMyAdmin.conf according to the Link you are using and restart the apache web server.
sudo service httpd restart
You can access PHPMyAdmin by http://ec2-ip-address/phpmyadmin
For Ubuntu/Debian Distro issue following commands:-
sudo apt-get install apache2
Then make changes in /etc/apache2/conf-enabled/phpmyadmin.conf according to the Link you are using and restart the apache web server.
sudo service apache2 restart
You can access PHPMyAdmin by http://ec2-ip-address/phpmyadmin

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.

Ubuntu 10 Apache Virtual Hosts suddenly missing

I have a bunch of apache virtual hosts set up on an Ubuntu machine. They were working for a long time and now they're not:
$ a2ensite /etc/apache2/sites-available/somesite.com
ERROR: No site found matching /etc/apache2/sites-available/somesite.com!
What could I have done wrong? This is happening for all virtual hosts on my machine. They are all there under /etc/apache2/sites-available/ but apache doesn't seem to see them.
You should use a2ensite somesite.com.

How can I configure Virtual Host without restarting Apache web server?

I created a new virtual host in apache web server and I dont want to restart Apache
Does Anybody know How can I configure VirtualHost without restarting Apache web server?
Also Is it possible to do it on windows server?
this is not possible .... you have to restart the server to get new / changed vhost.
what you can do is: restart the server without kill any active connections by:
/etc/init.d/apache2 -graceful [*]
[*] /etc/init.d/apache2 is your executable file
You can reload apache2 for get affect newly changes.
$ sudo systemctl reload apache2