how to change magento admin url and port , magento running varnish
Asked Answered
M

3

6

I have installed varnish on my server which uses magento.

the ports have changed so that varnish now runs on port 80 and magento runs on 8080,

there are certain features that will not work in the backend as the url is www.mystore.com/admin

but in fact the url to the store is www.mystore.com:8080/admin

can anyone help me change the backend port.

the feature that is not working is print packing slip, where i change the port in the javascript on the frontend it works. but there are tons of features so i need more than a quick fix

thank you

Melvinamelvyn answered 22/10, 2012 at 19:35 Comment(1)
It would help if you would post your varnish.vcl and apache vhosts file here. I have the almost same setup for all our projects (Varnish, PhoenixVarCache, but NGINX instead of Apache) and everything works even the admin panel is Varnish'd.Ornamental
R
7

To change the admin url you go to the backend, go to System > Configuration > Admin > Admin Base URL and change the setting Use Custom Admin URL to Yes and fill out Custom Admin URL with the URL including the port http://myDomain.com:8080/

if you want your own path, you can do the same with Use Custom Admin Path and Custom Admin Path

Afterwards don'T forget to do a rm -rf on var/cache in magento dir.

And as the others already mentioned, don't use varnish for the admin area, maybe you want to deactivate the reports for the users.

Ruff answered 25/10, 2012 at 16:52 Comment(1)
Removing the cache is very important. I had trouble with this until I removed the cache.Canker
C
5

You may want to consider disabling Varnish for the Admin pages. The Administrators of the site probably won't generate enough traffic to do anything serious to the database and they deserve to have the most up to date information. In our Varnish, we told varnish to pass through (don't cache) pages with /admin

Countersubject answered 22/10, 2012 at 19:46 Comment(2)
so would this work if (req.url ~ "^/(index.php/)?admin") { return(pass); } in the vcl file.... do i have to restart varnish and apache? alsoMelvinamelvyn
but even so, this dosnt seem correct, as apache is running of port 8080, the link for printing the packing slips needs to be on port 8080, also the website is live and i can't test till night timeMelvinamelvyn
U
1

Here is an excerpt from our varnish.vcl:

# Don't cache pages for Magento Admin
# FIXME: change this rule if you use custom url in admin
if (req.url ~ "^/(index.php/)?admin") {
    return(pass);
}

# Don't cache checkout/customer pages, product compare
if (req.url ~ "^/(index.php/)?(checkout|customer|catalog/product_compare|wishlist)") {
    return(pass);
}

It might serve as an example for you.

Unable answered 23/10, 2012 at 0:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.