NewRelic with Prestashop Ecommerce Site - php

I have a Prestashop Site running on a Virtual Private Server (VPS)
in which I have correctly installed PHP New Relic Agent.
The agent is working fine and sending data to rpm.newrelic.
However, i have many web apps running on my VPS, under public_html/*
I want to discriminate on New Relic Dashboard the metrics for one particular site. Now is just saying 'PHP Application' and displaying data for all the server usage, including even phpmyadmin!
I know that I have to set (through New Relic PHP API) the following:
if (extension_loaded('newrelic')) {
newrelic_set_appname($name);
}
But where shall i put this snippet of code, inside a Prestashop ecommerce instalation?
Is there another way to do this, for each app that I have on my VPS?
Thanks

did you try to add this lines at the file: /config/config.inc.php?
This file uses only at the Prestashop, so other applications should not be able to influence to newrelic stats.
Regards, Alex

Related

How do I access a Magento 2 website codebase / directory files?

As you can probably tell, I am new to Magento2 and I am trying to figure out some of the basics. I'm a full-stack developer that is use to developing (frontend and backend) myself then using docker and finally hosting it on an AWS:S3/EC2 or AWS: Elastic Beanstalk. With that said, Magento seems like a completely different beast to conquer.
I have a family member who is wanting me to do some basic frontend stuff for their website (such as changing Navbar design and a potential home page overhaul later on), naturally wanting to help them out I agreed to have a look and see what I can do. I have access to their Magento 2 dashboard area and have been looking around with no sure luck thus far. I have researched online that Magento 2 allows for a "Page Builder" or a "WYSIWYG" type functionality. But I am unable to use these types of tools because my family member had the website built by a Magento 2 developer firm awhile back and everything is coded manually and could cause problems if using one of the above mentioned tools. Due to this I am trying to get access to their site directory so that I can go in and make the necessary changes and upload the files. But I am really struggling on how to access the codebase.
I have read that an admin needs to send me the code??? Or grant me access to the code or something along those lines? I do have the host, port, root, username, password, etc. for the live server but still having trouble.
Any help would be greatly appreciated.
You need to use ssh to access the server
ssh user#host -p port
After you get into the server, you should set up a git repository in the project root and push the code from the server to the repository, then clone the repo to your local environment.
From there on, it's the normal development flow. You can use a clean database with sample data or you can dump the db from the live env and use it on your local env, but this will require some changes in the db after the import.
Detailing all the steps required to do this task would take forever and would cover a lot of different issues/steps.
"I have read that an admin needs to send me the code???"
Not sure what you mean by this, but a Magento admin is just a user on the backend side of the website. He does not have access to any code.
A git repository admin(probably previous dev) could grant you access to the code repository, but this doesn't seem like an option.

USB Key web server with protected php scripts

I just started to work for a new customer. He sell access to his Cloud App, written in PHP/MySQL. Recently he got an inquiry from two of his customers asking if he could install the tool locally.
Before doing so, he would like to ask one of his representative to perform a demonstration on site, and asked me if I could create a portable version of the app on USB Drive.
There's no issue with that, except he want the PHP Scripts to be protected/encrypted, so they could not be just copied over.
Do you know how I could manage to do this? Do I have to set up a virtual machine with protected contents? Should I use any existing tool allowing to protect things like that?

how to manage magento multi site in local and in live server

I am still new to magento. I have successfully installed magento ce on my local wamp server. I choose magento because I heard that it has multi site feature. My client have three separate website that are running on three domain name(www.sample1.com, www.sample2.com, www.sample3.com). I am planning to control them on one admin.
I would like to know how can I manage to create multi site on my local and how can I upload it on live server.
Also, can someone explain to me in simple the architecture of multi site of magento. If I'm not mistaken, I understood it this way.
admin -> my backend maybe running soon www.sample1.com that handles all my website.
website -> This is where I will give separate domain. for example website one is running on www.sample1.com. website two is running on www.sample2.com. and finally website three is running on www.sample3.com
store -> I don't have clear understanding of it.
store view -> this is the presentation layer. the most fron-end of the website where products, themes are displayed.
This is kind of stupid but i'm still new to magento.
Thanks!

Deploying custom website onto clients hosting

I have developed a website application that includes a custom built CMS and PayPal payments etc...
My client already has hosting for his main website via the developer of that site.
I wish to host the new application under a subdomain such as:
application.website.com
I have reservations about storing my complete source code on the other web designers server.
Is there a way that the code can remain on my server but with the required subdomain or somehow password protect the folder?
Thanks for the help.
You might be able to store your source code on your server and use the PHP include function to get the pages on your client's website to use the code on your server. I've not tried this so it may not be possible for PHP to communicate between two servers like this, but give it a go and see what happens.

Is it possible to run PHP and WCF on the same Azure instance?

I'm investigating the possibility of hosting a CMS (wordpress written in php) on Azure. I'm already running an ASP.NET Web Role which exposes WCF services. WordPress requires PHP. All my research suggests that I should create a new CGI Web Role to handle the PHP functionality. Is it possible to run the CGI Web Role and the ASP.NET Web Role under a single Azure instance? Or will I need two instances (one for asp.net; other for cgi)?
Actually, the "CGI Web Role" is just a web role with some FastCGI settings already populated. You can still put ASP.NET (or WCF services) there alongside the PHP. See http://blog.smarx.com/posts/php-asp-net-in-windows-azure for an example (but the demo app is no longer up).
You should look at the latest Windows Azure Companion that will let you do this. This will install an administrative website in a worker role and let you then install PHP-based tools such as WordPress, along with PHP itelf, via menu.
If you look at the source code of the Azure Companion, you'll see how the hosted web core is being launched. If you need to customize things beyond what the companion lets you do, you have all the code you need right there.
In a worker role, you can host multiple TCP ports, so it's very reasonable to have background workers running in the same role instance as your WordPress site.
Slightly unrelated: In a Web Role, you can still have background processes, but you'll just be unable to open arbitrary ports. You'll be fine creating, say, queue listeners. Just fire up your code in the Run() method (you'll need to add this, as it doesn't get added by default with a Web Role, only in the Worker Role template).
The flexibility of the Worker role enables you to run almost anything, including IIS itself :) You can use a role to host your own instance of IIS Hostable Web Core, which can leverage a few more of the features of IIS (like multiple applications) and likely enable you to do what you are wanting with a single instance. I don't have a ton of experience doing this myself, just know its possible.
The best example I've seen is at Steve Marx's blog
http://blog.smarx.com/posts/build-your-own-web-role-running-hosted-web-core-in-windows-azure
Beyond that, search around for "hostable web core on Azure" and you'll find some good resources.

Categories