I want to deploy my angular app on 000webhost. I used ng build to build my project and I uploaded my dist files to the file manager of the webhost. However, my website contains php files with credentials and urls linking to folders in the project such as :
baseUrl:string = "http://localhost/lfsa-db/php";
return this.httpClient.post(this.baseUrl + '/register.php', { first_name,last_name,father_name})
My dist files are all .js with the index.html. How can I edit these lines of code ? They were in a .php file before building the project.
Navigate to where your files are stored, make changes to those files and re compile your app / refresh the page. When you upload your files to 000webhost you should be able to make changes to them. If you can't, make changes to your angular app locally and re upload the files.
Hope this answers your question.
This is just my personal preference but I would use a git hub repo and deploy that. Using github will allow you to make commits to your branches and your web app will pull from the git hub, easy way to make changes after deploying.
When using webhosting software linking to a github gives you more control, at least in my opinion.
Related
I'm building a social media network and I want to make the code publicly available so that anyone can contribute.
Can I use GitHub for this purpose?
Also, how do I decide which files should be hosted on the GitHub repository?
Yes, you can use Github or Bitbucket.
On which files should be on hosted on Github,
You should never have configuration files in your codebase.
You should not have node_modules
Based on the framework and technology stack you select, you can create your .gitignore file using https://www.gitignore.io/ to ensure that you don't commit configuration files, environment files, etc.
I successfully deployed a Wordpress website on Heroku.
Here is what I did:
Download wordpress
Push all file on a Github repository
Create Heroku app
Link Heroku app to Github repository
Create clearDB database and update to wordpress config file
Deploy
Everythings is working fine. But whenever I update a file on the github repository and redeploy the heroku app, all user generated content are getting overwritten such as plugins and media contents.
How can I update my wordpress source code without losing any content?
Heroku has an ephemeral file system, meaning that any files that are saved to the Heroku instance while running, will be removed on your next application push. This is why there aren't many easy buildpacks for WordPress. All files "added" to your app have to be hosted elsewhere, like S3. Which makes it not necessarily ideal for a WordPress app without significant modifications.
I use Heroku for a lot of our infrastructure, but for WordPress sites I use Flywheel. (http://getflywheel.com) They have great support, have a handy local app that harnesses a virtual machine that is virtually identical to their live builds, and support intelligent Staging environments. I use DeployHQ to automate the build process similar to how Heroku does it. Pushing my repo will trigger a DeployHQ build to push code to Staging or Production, without affecting any user uploaded content/etc.
I am developing a web application using Laravel. I am using Laravel Forge with a Linode server and GitHub. My site is live at the moment. Whenever I change the code, I commit the changes using GitHub for Windows and then deploy the website on Laravel Forge.
One part of my application allows a user to upload a file. This works grand. I can upload a file and then download it from another computer on the website. However, I am not sure how to view the files on my server. They are not appearing on GitHub, and I cannot see anywhere on Laravel Forge to locate these files.
Anyone have any ideas?
The files are definitely there as I said, I can download and view the files once they are uploaded. I am storing them in a files folder in my public directory.
I guess your problem is that the versioner(Git) is ignoring your files.
Verify that where your files are stored and that the .gitignore files in each folder do not ignore them
*
/ Storage_path
Storage_file.extension
*.extension
Modify your corresponding .gitignore files and then commit everything
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.
I have a web hosting which hold a website I run.
I'm learning CodeIgniter so I would like to upload it a file in that web hosting and run some test and learn, CodeIgniter just for test, and keep using the website normally for users.
Is there any related or known issues or problem by running both ? I don't want the website to get frozen or act weird wit this.
Install codeigniter in it's own folder in a subdirectory instead of in the web root directory.
You will have to modify your config:
Installing a CodeIgniter application in a subfolder
Create a New Folder for your CodeIgniter Learning and Upload all CI files there including System folder and other.
If you Upload the the files with current website files folder it may create some issue.