Installing Snipe-IT on Azure Web Apps - php

Has anyone here been able to install Snipe-IT (Open source asset management: https://snipe-it.readme.io/docs) on Azure Web Apps?
I know it is possible to install it on an Azure VM, since I've done that, but I would prefer it to be on a Web App so we keep everything simple and slightly more secure.
I have been able to download it from GitHub, and it then says that the document root is incorrect (It has to be \wwwroot\public instead of \wwwroot). So, I go ahead and change the document root to the public, but then the page returns a 500 error. I see that I need to install Composer, so I install the extension for that, but nothing changes. I know the document root works correctly because I am able to place a test file in the public directory and it works fine. It is just the actual Snipe-IT install that gets screwed up.

Here's how I did it:
Run the command composer install under \wwwroot folder to install dependencies.
Change the document root by setting the virtual application path for the web app.
Edit the Snipe-IT configuration file (.env file) to configure the database credentials, app key and so on.
Restart the app service.
Finally, It worked for me.

Related

Git Clone Laravel Website just displays files and directories

I'm still really new to Git version control and Laravel. But I have gotten so far, and I'm not sure now where I am going wrong.
I set up VirtualBox and Vagrant on my local windows machine and installed homestead successfully. I have managed to get my Laravel website (it's only one page at the moment as I learn things) working correctly, it displays the header and the footer and the images load and everything. So that's all good.
So now, I have my Laravel website set up within my virtual vagrant server. On this server, the directory for my website is:
/home/vagrant/Code/sites/public_html
No when I cd to that directory, I ran the following:
git init
get remote add origin https://user#repo/user/publichtml.git
git add *
git commit -m "Initial Commit"
git push -u origin master
(I've substituted user#repo instead of the real URL)
All went through successfully. Great. So now on my live server I ran the following:
cd /home/sites/public_html
git init
git clone https://user#repo/user/publichtml.git
Which again, worked fine. It downloaded all the files into the public_html directory which is great. So then I go to visit the website and this is what I get:
The only explanation for this happening is maybe I need to install something on the server before I clone these files to it. I guess the files in the Laravel folder won't run by themselves? Do I need to install composer and laravel on the server or something? If so, how do I do that, and why don't they run on their own?
I cannot see a .htaccess or index.php in the root directory so I am not sure how it runs anyway.
You should install Laravel using composer instead.
composer create-project laravel/laravel mysite
You should also point the document root on your web server to laravels "/public" folder, making the framework code reside outside of the document root. That's good for security (no one can access any framework code, like your configs etc directly).
You will then find the .htaccess-file in the /public folder.
Please read the Laravel documentation about the different but recommended ways to install Laravel.
Btw, doesn't homestead use Nginx instead of Apache? In that case, .htaccess isn't even used. Please refer to the Laravel documentation again regarding homestead.
You need to redirect traffic to public/index.php instructions for this are webserver dependent.

Following services are not running: proxy # AWS -- after Laravel re-config

I have Laravel application which I learned to run both with php artisan serve and with local Apache.
Now I wish to run the same on Amazon Beanstalk.
I have created Beanstalk instance for PHP7. Then I went to Amazon Linux console and installed composer there. I think this was unneeded step.
Next I acrhived all my Laravel project with ZIP and uploaded it to AWS with web console. First I got Forbidden error
as said here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-laravel-tutorial.html
Then I fixed document root to public/ as said below and now I have health state severe saying
Impaired services on all instances.
Following services are not running: proxy.
When I am opening site with browser, I see blank page.
How to see any logs in AWS to understand what is happening?
What cen be a reason? Project is self-contained, it uses SQLite database inside the codebase. When I was enabling this project on local machine, I was to enable multiple things in Apache and PHP.
It was the problem with ZIP file structure: it contained extra top directory inside. So, on AWS it was /var/app/current/myappname while should be just /var/app/current.
Did you install mbstring after creating the instance?
sudo yum install php70w-mbstring
If this isn't the problem, you can view Laravel log in storage/log/laravel.log and tell us what is there to help you.
I was getting this error due to Elastic Beanstalk config settings being incorrect, specifically, the Document root was incorrect and was seeing the Following services are not running: proxy. error in the event log.
When generating the ZIP archive, be sure to generate it within the project folder. So when you open the zip file, you have the app folder, not another folder with the project name.

Deploying a Symfony2 App onto Azure Web hosting

what my aim here is to, upload my project that is basically a controller returning a twig template its as simple as that, i just cant figure out how to get it on the hosting.
I have been using symfony for a few months now, so still new to it all. and all the hosting/details stuff is new too me.
Whats throwing me off is my understanding of a hosting web/ folder
and how azures its wwwroot/
i used this website
http://symfony.com/doc/current/cookbook/deployment/azure-website.html
but i'm finding it rather difficult to follow it..
does anyone have any better sites with more clear steps on how to deploy? i've read a lot about a public_html folder but i've never heard/used it before
If someone could explain how the www.domain.com/web/app.php works that would help, i know that, that is the file that is called, but not too sure if i need to say call this file "app.php" or if its done kinda like the way a standard websites looks for 'index.php'
any kinda help or pointers would be much appreciated here as i'm kinda lost
Generally, we can build our project and test on local, then deploy on Azure Web Apps via Git or FTP tools.
Here is my test steps:
Build Symfony project on local, referring Using the Symfony full-stack framework
Login to Azure preview Portal, click NEW=> Web+Mobile=> Marketplace, in Web Apps section click Web app + MySQL, then click create.
When finishing creating Web app service, we can find MySQL connection string in Settings=>Application settings=>Connection strings click show connection string.
then click Set up continuous deployment in Deployment section. Select Local Git Repository for the source. Then in Essentials section, we can find there added a Git URL. Copy it.
In your local symfony project, make sure your Symfony repository has a .gitignore file at its root directory with at least the following contents:
/app/bootstrap.php.cache
/app/cache/*
/app/config/parameters.yml
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep
/app/SymfonyRequirements.php
/build/
/vendor/
/bin/
/composer.phar
/web/app_dev.php
/web/bundles/
/web/config.php
run the following commands to init git repo and first-time push to Azure:
`
git init
git add .
git commit -m "initial commit"
git remote add azure [URL for remote repository]
git push azure master
Sign on Kudu console of your Azure web site, at https://<your-website-name>.scm.azurewebsites.net/DebugConsole, run following commands:
cd site\wwwroot
curl -sS https://getcomposer.org/installer | php
php composer.phar install
Now visit http://<your-website-name>.azurewebsites.net/web/app.php in browser, we should see the project.
Now we need to configure URL rewrite to remove /web/app.php pattern of the url. Add a file named web.config with the content shown in Deploying to Microsoft Azure Website Cloud in the root directory which is /site/wwwroot on Azure. Click restart on Azure portal, now we can visit the site at http://<your-website-name>.azurewebsites.net .
By the way, for deploying a PHP-MySQL application on Azure Web Apps, we can get more information at Create a PHP-MySQL web app in Azure App Service and deploy using Git. And specifically for Symfony project, the Symfony guide is still useful, and we can ignore section Enabling the PHP intl Extension .
If you can't change the name of the "wwwroot" directory to "web", you have to change the configuration of symfony to use "wwwroot" instead.
Have a look at this page!
I think the easiest solution is the one with the symlink:
Some shared hosts have a public_html web directory root. Renaming your web directory from web to public_html is one way to make your Symfony project work on your shared host. Another way is to deploy your application to a directory outside of your web root, delete your public_html directory, and then replace it with a symbolic link to the web in your project.

deploy phpBB on openshift

I'm in a trouble trying to install phpBB on openshift.
I have created a php5.3 cartridge with PostgreSQL: I unpack phpbb on a folder of my app, I push the change, then I run the installation form the browser.
The forum installation is successful.
In the end I need to delete the "install" folder in order to enable the forum.
I tried it on my standalone wampp server and it works.
So I delete it in my repo, and I commit and push the change.
When the app restarts it automatically tries to go back to the installation: everything is broken.
It seems the push breaks the configuration on the server side.
I also have tried to change the name of the directory using ssh connection, and move the install directory name: this is uneffective.
What's the problem here?
The problem is that if you deploy the phpBB package as downloaded from official website app the files will go on app-deployments with are not persistent on git changes and can not be pull to local. You can try using the OpenShift quickdeply version of phpBB (https://github.com/openshift-quickstart/phpbb-example) that deploys the files to app-root/data (I think :S) and this reamins untouched on git changes.
The "install" folder is at app-root/runtime/repo/php

Issue with zend framework setup?

It seems I set up everything correctly. I received no errors.
I used zf create project and it created the project no problem.
I went to localhost/site and instead of showing the welcome to zend page it opens the directory and shows me its contents. I have to go to localhost/site/public to see that page.
I tried creating a new public action in the controller and added a file in the view scripts portion but it didn't show up.
The project is located in /var/www/html directory
What could I have forgotten?
Steps I took:
Updated repositories before downloading and installing stuff
Install linux
install apahce
install mysql
install php
install phpmyadmin
install zend framework minimal
install phpunit
install subversion (but did not combine it with zend)
That's about it, I didn't do anything more than that.
By default it is assumed you will run the project from a Virtual Host with the DOCUMENT_ROOT pointed at /path/to/project/public If you want to run the site in a subdirectory then this subdirectory should only contain the contents of what is currently in public, and you would need to modify the configuration settings to run with this setup.
Check out the Quickstart section "Create a Virtual Host" for more info.
The easier option here is just to create a Virtual Host for the project and add a host entry to /etc/hosts like:
127.0.0.1 zfproject.local

Categories