can't access apache from localhost using xampp - xampp

Hi I am very new to programming. I am trying to access apache through localhost and I am using xampp. Everything is running, when I type in localhost and it does show "it works!", but when i enter localhost/~alexpham/ it shows not found! I have created a folder inside user. Any help would be great. I have tried everything.
cd /etc/apache2/users
Directory "/Users/alexpham/Sites/">
Options Indexes MultiViews
AllowOverride All
Require all granted
Allow from all
/Directory>
Alexs-MacBook-Pro:users Alexpham$ sudo chmod 644 alexpham.conf
Alexs-MacBook-Pro:users Alexpham$ sudo apachectl restart
Alexs-MacBook-Pro:users Alexpham$ cd ~/Sites/
Alexs-MacBook-Pro:Sites Alexpham$ open .
Alexs-MacBook-Pro:Sites Alexpham$ nano index.html

Related

Deploy laravel apache (public access forbidden)

I deploy laravel project on apache web server and this is my .conf
this is my conf
and in my public_html I've 4 project
list of project
but when i go to mydomain.com/sso_NAP (for example) my browser show this error
error when i put /public in my conf
need help
Some Options parameters need the +/- syntax
Change:
Options Indexes FollowSymLinks MultiViews
to:
Options +Indexes +FollowSymLinks +MultiViews
if it is in linux/ubuntu, have you checked the directory permissions?
I had the same problem with my project in ubuntu, the solution in my case:
sudo chown -R www-data:www-data laravel-project/ && sudo chmod -R g+rw laravel-project/

What are the steps to deploy of laravel project on Debian?

I developed my Laravel Project on Windows using xampp. So I need to deploy this project in a Debian server. In this server, I've already installed apache2, php7.3 and composer. All fine. I transfered my project from Windows to Debian by ssh. Inside the project I had run composer update. But when I try to accesss via browser, I got 404 page not found error. Do I miss some step? Someone could please help me?
I missed to create an apache config to the new project:
Something like these:
sudo nano /etc/apache2/sites-available/meuprojeto.conf
Edit this file with the follow code:
DocumentRoot /var/www/html/meuprojeto/public
ServerName seudominio.com
Options +FollowSymlinks
AllowOverride All
Require all granted
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Config apache service to be sure it's enable:
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
Final steps:
Enable rewrite
sudo a2enmod rewrite
Enable your project config
sudo a2ensite meuprojeto.conf
Disable default config (default apache page)
sudo a2dissite 000-default.conf
Restart apache service
sudo systemctl restart apache2.service

Configure phpmyadmin on Windows with Apache24

I am trying to configure phpmyadmin on my localhost Apache24 server. I change the root file of the server with one costum, everything works fine, and when I am trying to add phpmyadmin I get this
phpmyadmin
I change the name of config.sample.inc.php into config.inc.php and a $cfg['blowfish_secret'] and doesn't help
config.inc.php
Thank you!
Check if you have installed your PHP correctly, by clicking on the index.php link on the list of your printscreen.
If you see a login page it means your PHP is ok, but you haven't informed your Apache to use index.php.
Run down your Apache configuration to the directory index and add index.php to the DirectoryIndex line like this:
DirectoryIndex index.php
first sorry form my bad inglis but i am spanish.
To install phpmyadmin follow next steps, are so easy.
First remove and purgue all old phpmyadmin files with ...
sudo apt remove --purgue phpmyadmin
Next step is install it again, use this commnand ...
sudo apt install php libapache2-mod-php php-mysql phpmyadmin php-mbstring php-gettext
Enable mbstring mod to php
sudo phpenmod mbstring
Next step is change dir mod
sudo nano /etc/apache2/mods-enabled/dir.conf
File content:
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
Finaly restart apache
sudo service apache2 restart
If you can't solve your problem with this steps reply me on this post.

Create a Vhost in Ubuntu 16.04

I have started working in laravel and using lampp. I have watched many tutorials that use a vhost to make user-friendly url. I want to do it on Ubuntu 16.04.
Following tutorial is not working for me:
https://ourcodeworld.com/articles/read/302/how-to-setup-a-virtual-host-locally-with-xampp-in-ubuntu
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/basicwebsite/public"
ServerName mywebsite.dev
</VirtualHost>
Setup a virtual host for a Laravel project
First, copy the default configuration file and rename it:
$sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/myVhost
open myVhost.conf file using this command:
$sudo nano /etc/apache2/sites-available/myVhost.conf
Add the directives:
assuming that the Laravel project is in /var/www/html/
ServerAdmin webmaster#localhost
serverName www.myAwesomeLink.com
DocumentRoot /var/www/html/laravel-app/public
<Directory /var/www/html/laravel-app>
AllowOverride All
</Directory>
so now the file will look something like this:
save and close.
Now add an entry in the hosts file:
$sudo nano /etc/hosts
add this line:
127.0.0.1 www.myAwesomeLink.com
save and close.
Enable site and the rewrite mode:
$sudo a2enmod rewrite
$sudo a2ensite myVhost.conf
Restart the server:
$sudo service apache2 restart
Serve the Laravel project:
open the project folder
php artisan serve
this will serve on port 8000 by default
you can also specify the port
php artisan serve --port=4200
Open the browser:
http://www.myAwesomeLink.com:8000
or any other specified port.
Source.
Its not working because the browsers have updated their security terms and policies including SSL certificates over .dev domains. just change your extension from .dev to something else like .localhost or .test.
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/basicwebsite/public"
ServerName dev.mywebsite.test
</VirtualHost>
Also change the extension in /etc/hosts from .dev to .test.
127.0.0.1 dev.mywebsite.test
Also keep in mind to restart the service to load the new added virtual host i.e: restart the Apache server
Hope it helps.
I think you also need to add a host in /etc/hosts. Open the hosts file and add this line:
127.0.0.1 mywebsite.dev
You will need to restart server after this.
1.Create new file under this path /etc/apache2/sites-available/myweb.conf
2.Copy the following to the file
# Indexes + Directory Root.
DirectoryIndex index.php
DocumentRoot /var/www/html/mywebsite/public
ServerName dev.mywebsite.test
<Directory "/var/www/html/mywebsite/public">
Options All
AllowOverride All
Allow from all
</Directory>
3.Run "sudo a2ensite myweb.conf"
4.Add this line "Listen 80" to file "/etc/apache2/ports.conf"
5.Restart apache server

Apache2 disable 000-default.conf HTTPS redirect

I have a problem with my local Apache webserver. I've diabled and removed the 000-default.conf file using the following commands as root user.
a2dissite /etc/apache2/sites-available/000-default.conf
rm /etc/apache2/sites-available/000-default.conf
I've created this new default.conf file, that redirects HTTP requests to the HTTPS version:
<VirtualHost *:80>
Redirect permanent / https://xxx.xxx.xxx.xxx/
</VirtualHost>
Finally I've enabled the site and restarted the sever using:
a2ensite /etc/apache2/sites-available/000-default.conf
/etc/init.d/apache2 restart
My problem is that my server does not apply the new settings. To me it seems as if it still uses the deleted 000-default.conf settings.
Use this
a2ensite /etc/apache2/sites-available/default.conf
/etc/init.d/apache2 restart
Here you are using wrong file name

Resources