Prestashop installation homestead guide - vagrant

So I had trouble while installing Prestashop 1.7 correctly and thought I would post my own guide to install it with Homestead (vagrant, virtualbox):
There we go:
Download prestashop
Have vagrant and homestead installed
Cd into your homestead folder and run vagrant - vagrant up
Extract ONLY THE FIRST zip in "...code\prestashop" folder
Configure homestead.yaml file by adding:
sites:
- map: prestashop.test
to: /home/vagrant/code/prestashop
php: "7.0"
databases:
- prestashop
add 192.168.10.10 prestashop.test to your hosts file
run vagrant provision
Open "prestashop.test" (or whatever other name you put in the homestead.yaml file) in browser
Proceed with prestashop installation
Comment out (_install) or delete the install folder (otherwise you will get an error when trying to open prestashop in the browser)
vagrant ssh
In vagrant ssh cd /etc/nginx/sites-available and run ls to see if prestashop is present
sudo nano prestashop.test
Add this between root and index and change the admin name on BOTH lines to your generated unique one:
location /admin/ {
if (!-e $request_filename) {
rewrite ^/.*$ /admin/index.php last;
}
}
then sudo /etc/init.d/nginx reload
Open prestashop.test/admin() (in the brackets put your unique admin name (without the brackets) and voilĂ !

Instead of having to edit Nginx config file you can simply use Apache, all that you have to do is to specified apache as a site type:
sites:
- map: prestashop.test
to: /home/vagrant/code/prestashop
php: "7.0
type: "apache"
It looks like there are some issues with Nginx that require to edit the config by hand just as #Todor did, more info here Does PrestaShop 1.7 work with Nginx? - General topics - PrestaShop Forums

In PS version: 1.7.6.7 i was forced to uncoment those two lines in .htaccess located in admin folder:
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(/(.*)) %{ENV:BASE}/$2 [R=301,L]
Before that for links like: http://presta17.shop/admin466vvxojo/improve/modules/manage?_token=ZrnM85TEsROusexXinPySyjZQghmfHO7d7sSFI3Tgm4
with /index.php/ i get only: Access denied.

Related

Where is the httpd-vhosts.conf located in XAMPP?

Where can I find the httpd-vhosts.conf file to setup virtual hosts when using XAMPP?
Windows: C:\XAMPP\apache\conf\extra\httpd-vhosts.conf
Mac: /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
Linux: /opt/lampp/etc/extra/httpd-vhosts.conf
Note that you have to edit the httpd.conf in the parent folder to include the file:
Include etc/extra/httpd-vhosts.conf
Alternatively, you can also insert virtual hosts in the httpd-xampp.conf which is included in XAMPP by default:
Windows: C:\XAMPP\apache\conf\extra\httpd-xampp.conf
Mac: /Applications/XAMPP/xamppfiles/etc/extra/httpd-xampp.conf
Linux: /opt/lampp/etc/extra/httpd-xampp.conf

How can I have multiple docroots with DDEV on apache?

In my ddev container, I configured multiple vhosts in Apache using conf files in sites-available that I added and enabled in the Dockerfile.
In the docs, it is said that we should use $WEBSERVER_DOCROOT which is /var/www/html by default but this value is not available in any custom conf files (apache-site.conf or sites-available files).
So I had to hardcode it and furthermore I had to do this in each conf file because I was unable to define a value for all vhosts and share it.
My Dockerfile :
ADD sites-available/my.site1.tld.conf /etc/apache2/sites-available
RUN a2ensite my.site1.tld
My conf files :
my.site1.tld.conf :
<VirtualHost *:80>
ServerName my.site1.tld
DocumentRoot $WEBSERVER_DOCROOT/my.site1.tld/www
</VirtualHost>
Finally, I could make it work. I had to copy the whole content of apache-site-default.conf from ddev apache configs
to apachesite.conf and append
Define WEBROOT $WEBSERVER_DOCROOT
at the end.
Then in each conf file in sites-available I can retrieve the value as ${webroot}.
I thought that apache.conf was automatically appended to the default conf but it is not the case. I would have preferred to use Macro but I could not succeed (adding RUN a2enmod macro && a2enconf myvhost-macro didn't work).
In DDEV-Local v1.15+, the ability to do multiple docroots with both Apache and Nginx is built-in. There's even an example in the .ddev/nginx_full and .ddev/apache directories showing exactly how to do it.

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.

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

I have configured a vagrant file, and I need a dev.domain.com pointing to 55.55.55.5/public

I have configured a vagrant file, and I need a dev.domain.com pointing to 55.55.55.5/public
My website works with the /public folder, but in the dev.domain.com I need to enter to public/ to see the page, so all styles, javascripts and files that points to "/", are broken due to the /public in the url.
Anyone can help me?
vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "avenuefactory/lamp"
config.vm.network "private_network", ip: "55.55.55.5"
config.vm.synced_folder ".", "/var/www/html", create: true, group: "www-data", owner: "www-data"
end
hosts file :
55.55.55.5 dev.domain.com
What I need is "something" making dev.domain.com pointing to 55.55.55.5/public.
I solved it, and I want to share the answer. I use an answer from other post: https://stackoverflow.com/a/23175981/3685739
I made all this changes through the vagrant ssh, in the webserver.
Please note, that this only applies for Ubuntu 14.04 LTS and newer
releases.
In my Ubuntu 14.04 LTS, the document root was set to /var/www/html. It
was configured in the following file:
/etc/apache2/sites-available/000-default.conf
So just do a
sudo nano /etc/apache2/sites-available/000-default.conf
and change the following line to what you want:
DocumentRoot /var/www/html
Also do a
sudo nano /etc/apache2/apache2.conf
and find this
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
and change /var/www/html to your preferred directory
and save it.
After you saved your changes, just restart the apache2 webserver and
you'll be done :)
sudo service apache2 restart

Resources