Synology DSM6 versus Slim Framework - slim

I try for a while to make Slim Framework working on my Synology (DSM 6.1.3-15152 Update 1).
I already played with Slim in the past so I thought that will be easy... but nah... can't make the routing work. Always get a 404 except for the root.
I did make my .htaccess file correctly, but I can put anything in it the website just act as if the file was not there.
So it must be the AllowOverride All the problem...
and here I am : tons of .conf and other files that look like what I need but every time it don't work.
I'm not even sure to know if I have to restart something after editing / creating a someting.conf in some site-enabled folder.. so I restart everything. (webStation + apache server) and it take a looOong time to restart...
I try to make it work with WebStation + Apache Http Server 2.4 (as making it work with nginx look like even more complicated). The website is a virtualhost on port 7878...
I can access my Synology using ssh... so if someone know how to do it I will be glad. I loved Slim framework in a past project and I would like to use it again but man...
Thanks.

This is dumb. I use a tool to sync my local files to my Synology. This tool always told me "everything sync successfully"... I just realized, this tool do not sync file that start with a "."
I was using Cloud Station Drive to sync my files and by default the option to sync file starting with a "." is disabled. I realized it by going straight in the folder using ssh.
I created manually my .htaccess file and now everything work.
I leave it here in case someone get the same stupid problem...

Related

TYPO3 DDEV installation upload to server

I have a local ddev based TYPO3 site. If I want to upload it on my apache server there is some path issues with the resource files like JS,CSS and images.
This is the path for the css file on my local server... this works perfect:
typo3conf/ext/sitepackage/Resources/Public/Dist/Css/main.css
On my apache server following path gives a 404 error
/typo3conf/ext/sitepackage/Resources/Public/Dist/Css/main.css
Is there a way to change the base path of the production environment?
This article describes your issue probably.
The main issue if you want to keep the old structure is to use
"typo3/cms-composer-installers": "^2.0 || ^3.0"
without version 4.
Else the whole structure is created differently.
Nevertheless you might be able to repair the current state by using paths like this:
EXT:sitepackage/...
as soon as you use typo3conf/ext directly it won't work.
Certainly you could create symlinks but that's likely not the best approach.

How to setup existing TYPO3 project in our local machine?

I am newbie to TYPO3 and having a situation where I have to setup an existing TYPO3 website in my local machine so, I can make changes in some pages but the problem is that I don't have any experience with TYPO3.
What I have:
I have FTP access to the development server but don't know which folders/files are required to make it work in the local machine.
What I have tried:
I had searched regarding this on the internet and also read some past StackOverflow questions but don't find any positive response.
If someone can guide me through then it would be very helpful... Thanks!
first: you need a webserver running PHP and a database (probably mySQL).
This should match the running server.
You might use DDEV to put it all into a virtual machine and get a better match, but any webserver with PHP and mysql should do.
TYPO3 can be running in two ways:
composer mode
non composer mode
if it runs in composer mode you also need composer (and git) installed. But the copy is easier as you only need to copy the composer.lock-file and do an composer install to copy all code.
additional you need to copy all data.
that is the database.
the whole folder /fileadmin (based in webroot)
in non-composer mode you need to:
install the same TYPO3 version (typical somewhere with a symlink /typo3/ -> your location/ in the webroot.
then look for /index.php on the original server and copy it (it could be a symlink)
additional you need to copy the folder /typo3conf from the server.
and of course the data as above
then you might need to adapt /typo3conf/LocalConfiguration.php and /typo3conf/AddionalConfiguration.php. (database credentials/ domain specific info/ ...)
since TYPO3 9 you probably have a yaml config file outside the webroot.

Changes in conf/server.xml does not seem to have any effect during runtime

Here's what I know:
When uploading files given by users, we should put them in a folder
outside the deployment folder. Let me call it D:\uploads.
We should (somehow) add that folder (D:\uploads) as a web app context.
Here's what I did:
I upload my files to the folder D:\uploads.
I tried adding the web app context as it's mentionned here by adding the following row to TOMCAT_DIR/conf/server.xml:
<Context docBase="D:\uploads" path="/uploads"/>
But that doesn't have any effect. When consulting http://localhost:8080/uploads/file.png or http://localhost:8080/uploads I get a HTTP Status 404 error.
So what I want to know:
What did I do wrong ? How can I add my upload folder to Tomcat?
Is there any better approach when it comes to uploading files ?
Because I'm wondering what should I change if I want to deploy my
application to another server where there's no D:\uploads.
Change the docBase attribute. Use D:/uploads (with slash) instead of D:\uploads (with backslash).
When dealing with files in Java, you can safely use / (slash, not backslash) on all platforms.
Regarding the differences you mentioned in the comments when starting the Tomcat from the IDE and from bin/startup.bat: It's very likely when you start the Tomcat from the IDE, it is not using the same context.xml your Tomcat is using. Just review the Tomcat settings in the IDE.
How to store uploaded files is a common topic at Stack Overflow. Just look around and you'll get surprised in how this topic is popular.
If you aren't happy enough in storing your files in D:/uploads or you'll have other servers accessing the files, you could consider storing them in some location in your network. Depending on your requirements, you can have one dedicated server to store your files or just share the folder which contains the files in your current server. The right decision will always depend on your requirements.

Netbeans - Open remote folder/new project

I have been using Netbeans for several months now and like it a lot. I am trying to enable a way to create a project which accesses live files on my server to make changes. When I create a project using a remote source, it starts downloading all the server files to my computer. This would be just fine, except for the fact that (a) the server has a few gigs of files on it and (b) there are two of us that will be making changes on the server.
In the past, I have worked with IDEs that just open an FTP or SFTP connection and will download the file you want to edit, and then upload that file back to the server when you save it. Preferably, this is what I would like Netbeans to do.
I have tried adding a FTP folder in Windows, but Netbeans won't open it. I have tried using Swish and setting up an SFTP folder, and Netbeans won't find the Swish folder altogether.
On a side note, I understand what I am doing is horrible practice, but it is a small site and I am usually the only one working on it. I haven't worked on the website in the past several weeks and just thought it would be easier to get access directly than re-downloading the entire server's worth of code/images/videos/etc. Any help would be appreciated.
NetBeans does not support what you want to do. However, if you put your site under Subversion/Git (revision control), you could check out the content, modify it locally and push modification back remotely.
This would also help avoiding code clashes when your friends work on your website too.
Actually Netbeans supports this for php projects.
Just choose :
PHP Application from remote server
(but git is the best solution anw as it gives you version control as well but the above is useful if you want your server files to be updated when you just press ctr+s)

Zend Framework Setup on Hostmonster?

I have created a project locally using Zend Framework 1.11. I have spent a long time learning the basics of the framework from all the online tutorials I can find, and I now feel fairly comfortable using the ZF Tool and locally working on my project on WAMP. I decided it was time to upload my project and deploy it on my shared hosting server, which happens to be Hostmonster.
After uploading my project, I have been struggling to get it to function correctly on the remote host. I have successfully uploaded my Zend Framework Library and included it in my PHP.ini, and all tests show it is seen by the server.
My directory structure, which was originally created to the standard format by the ZF Tool locally on the command line, is not pointing to the same paths on the remote server, so everything was messed up when I navigated to the Project/public folder. After much more Googling, I found several posts by various bloggers related to modifying .htaccess files, etc., which resulted in all my other sites hosted on the server being disrupted.
The closest I have been able to come to re-creating my initial local site on the Hostmonster host is by:
Taking all the directories out of my "public" ZF folder, and putting them directly in the web root of my server, (public_html), and:
Changing the 'APPLICATON_PATH' of my index.php file from the ZF public folder with the path to my ZF library (changed to reflect where it is in relation to the new location).
With this (tedious) setup, I am now seeing my index view being rendered with all CSS and Javascript, but I am unable to navigate to any of the other views, and the form I have displayed via a view script is likewise not showing up, only the index view is rendered.
My Zend Framework Library is located in a directory in the web root-- public_html, with the php.ini adding it to the include path.
This is becoming very frustrating as I like a lot of the features of ZF, but the restructuring of the site is proving impossible. If anyone has instructions or experience with this setup, I would greatly appreciate it. I am also hosting multiple other sites on this server, so I'm hoping I don't have to change from the single php.ini configuration(5.3) I'm currently using or mess around with a bunch of .htaccess files.
Thanks for any help anyone may have!
I have ZF running on HM no problem. Just place your index.php and .htaccess in your public_html dir, and what I did was created a public_html/zend/library folder and in my index.php including that library to get things working.
Also what do u mean you're running other sites off this server? Are you serving the application on the root of your domain? ie in your http://domain.com/ path? or different subdomains?